X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Fwm_render_text.c;h=4ce35cb7df8b0547dd7494ad5c6358f6786320b1;hb=a644ed9dc9954091daf616dfe93ab2e2a920bf5d;hp=9135ed3d5d7b4f4eb040ba32bbcf412f3b7055d0;hpb=82a4f841eafaff80b7dc258099abd865faaa0467;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/wm_render_text.c b/Usermode/Applications/axwin3_src/WM/wm_render_text.c index 9135ed3d..4ce35cb7 100644 --- a/Usermode/Applications/axwin3_src/WM/wm_render_text.c +++ b/Usermode/Applications/axwin3_src/WM/wm_render_text.c @@ -73,18 +73,24 @@ int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, tGlyph *glyph; uint32_t ch = 0; - _SysDebug("WM_Render_DrawText: (X=%i,Y=%i,W=%i,H=%i,Font=%p,", X, Y, W, H, Font); - _SysDebug(" Colour=%08x,Text='%s')", Colour, Text); +// _SysDebug("WM_Render_DrawText: (X=%i,Y=%i,W=%i,H=%i,Font=%p,", X, Y, W, H, Font); +// _SysDebug(" Colour=%08x,Text='%s')", Colour, Text); if(!Text) return 0; + + X += Window->BorderL; + Y += Window->BorderT; + // Check the bounds - if(W < 0 || X < 0 || X >= Window->W) return 0; - if(X + W > Window->W) W = Window->W - X; + if(W < 0 || X < 0 || X >= Window->RealW) return 0; + if(X + W > Window->RealW) W = Window->RealW - X; - if(H < 0 || Y < 0 || Y >= Window->H) return 0; - if(Y + H > Window->H) H = Window->H - Y; + if(H < 0 || Y < 0 || Y >= Window->RealH) return 0; + if(Y + H > Window->RealH) H = Window->RealH - Y; + // TODO: Catch trampling of decorations + // Handle NULL font (system default monospace) if( !Font ) Font = &gSystemFont; @@ -239,7 +245,7 @@ void _RenderGlyph(tWindow *Window, short X, short Y, tGlyph *Glyph, uint32_t Col } // _SysDebug("X = %i, Y = %i", X, Y); - outBuf = (uint32_t*)Window->RenderBuffer + Y*Window->W + X; + outBuf = (uint32_t*)Window->RenderBuffer + Y*Window->RealW + X; inBuf = Glyph->Bitmap + yStart*Glyph->TrueWidth; for( y = yStart; y < Glyph->TrueHeight; y ++ ) @@ -248,7 +254,7 @@ void _RenderGlyph(tWindow *Window, short X, short Y, tGlyph *Glyph, uint32_t Col { outBuf[dst_x] = Video_AlphaBlend( outBuf[dst_x], Color, inBuf[x] ); } - outBuf += Window->W; + outBuf += Window->RealW; inBuf += Glyph->TrueWidth; } }