Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 80 - Bogus glyph position #20

Open
netsweng opened this issue Aug 18, 2013 · 1 comment
Open

Bug 80 - Bogus glyph position #20

netsweng opened this issue Aug 18, 2013 · 1 comment

Comments

@netsweng
Copy link
Member

Samuel Thibault 2009-01-16 12:27:26 EST

Created an attachment (id=18) [details]
fix

Hello,

I typically do something like

putcircle_with_text(SWFShape shape, int x, int y) {
SWFShape_MovePenTo(x,y);
SWFShape_drawCircle(shape, 10);
SWFShape_MovePen(10,10);
SWFShape_drawSizedGlyph(shape, 'A', 10);
}

and then call putcircle_with_text with varying values of x and y. That
however puts text in very odd places. This is because when pasting the
glyph drawing events, the scale is applied to the offset as well, not
only to the relative glyph drawing events. Here is a patch that works
for me.

@netsweng
Copy link
Member Author

Index: src/blocks/shape.c

RCS file: /cvsroot/ming/ming/src/blocks/shape.c,v
retrieving revision 1.55
diff -u -p -r1.55 shape.c
--- src/blocks/shape.c 12 Sep 2008 09:13:36 -0000 1.55
+++ src/blocks/shape.c 16 Jan 2009 17:06:08 -0000
@@ -449,10 +449,10 @@ static ShapeRecord addShapeRecord(SWFSha
calloc(1,sizeof(struct stateChangeRecord));
*change = *record.record.stateChange;
shape->records[shape->nRecords].record.stateChange = change;

  •       change->moveToX += shape->xpos;
    
  •       change->moveToY += shape->ypos;
        change->moveToX *= scale;
        change->moveToY *= scale;
    
  •       change->moveToX += shape->xpos;
    
  •       change->moveToY += shape->ypos;
    
        *vx = change->moveToX;
        *vy = change->moveToY;
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant