Skip to content

Commit

Permalink
Fix offset of left-clipped text character. Tweak rounding of font sca…
Browse files Browse the repository at this point in the history
…ling when rounding down
  • Loading branch information
hughsando committed Jul 9, 2024
1 parent 37e802e commit f08444f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions project/src/common/TextField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1915,11 +1915,12 @@ void TextField::Render( const RenderTarget &inTarget, const RenderState &inState
float *tint = cid>=mSelectMin && cid<mSelectMax ? white : groupColour;
Rect r = tile.mRect;

if (pos.x < GAP)
if (pos.x < GAP )
{
int dx = (GAP-pos.x)*fontScale + 0.001;
r.x += dx;
r.w -= dx;
p.x = GAP;
}

if (right>clipRight)
Expand Down Expand Up @@ -2734,7 +2735,7 @@ CharGroup::~CharGroup()

bool CharGroup::UpdateFont(double inScale,bool inNative, AntiAliasType aaType)
{
int h = 0.5 + inScale*mFormat->size;
int h = (inScale>=1.0 ? 0.5 : 0) + inScale*mFormat->size;
int flags = (mFormat->bold.Get() ? 1 : 0 ) |
(mFormat->italic.Get() ? 2 : 0 ) |
(mFormat->underline.Get() ? 4 : 0 );
Expand Down

0 comments on commit f08444f

Please sign in to comment.