Menu

#26 Image markers ignore anchor

open
nobody
None
5
2004-02-19
2004-02-19
Simon White
No

Updating to a new version of blt (2.4z patch level 2)
caused all our image markers to become offset from
there intended locations. Looking at the code in
bltGrMarker.c I found anchor is now ignored when
imPtr->srcImage == NULL. This patch fixes things:

@@ -2211,8 +2211,9 @@
Tk_SizeOfImage(imPtr->tkImage, &srcWidth,
&srcHeight);
imPtr->width = srcWidth;
imPtr->height = srcHeight;
- imPtr->anchorPos.x = corner1.x + imPtr->xOffset;
- imPtr->anchorPos.y = corner1.y + imPtr->yOffset;
+ imPtr->anchorPos = Blt_TranslatePoint(&corner1,
srcWidth, srcHeight, imPtr->anchor);
+ imPtr->anchorPos.x += imPtr->xOffset;
+ imPtr->anchorPos.y += imPtr->yOffset;
exts.left = imPtr->anchorPos.x;
exts.top = imPtr->anchorPos.y;
exts.right = exts.left + srcWidth - 1;

Discussion


Log in to post a comment.