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=362669bf323b41eab2e76d4d97bdb6f8016c55c9;hpb=cb0be723b41f33efa5d679426f4212e9f1719e1f;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 362669bf..4ce35cb7 100644 --- a/Usermode/Applications/axwin3_src/WM/wm_render_text.c +++ b/Usermode/Applications/axwin3_src/WM/wm_render_text.c @@ -78,13 +78,19 @@ int WM_Render_DrawText(tWindow *Window, int X, int Y, int W, int H, tFont *Font, 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; } }