Skip to content

Commit

Permalink
now allowing fractions of font sizes for Bitmap Fonts
Browse files Browse the repository at this point in the history
e.g. SP_NATIVE_FONT_SIZE * 2 or SP_NATIVE_FONT_SIZE * 0.25
  • Loading branch information
PrimaryFeather committed Oct 10, 2012
1 parent e0b3525 commit a047d46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sparrow/src/Classes/SPBitmapFont.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ - (SPDisplayObject *)createDisplayObjectWithWidth:(float)width height:(float)hei
{
SPSprite *lineContainer = [SPSprite sprite];

if (size == SP_NATIVE_FONT_SIZE) size = mSize;
float scale = size / mSize;
if (size < 0) size *= -mSize;

float scale = size / mSize;
lineContainer.scaleX = lineContainer.scaleY = scale;
float containerWidth = width / scale;
float containerHeight = height / scale;
Expand Down

0 comments on commit a047d46

Please sign in to comment.