diff options
author | joye <joye> | 2014-03-19 20:55:33 (GMT) |
---|---|---|
committer | joye <joye> | 2014-03-19 20:55:33 (GMT) |
commit | 4436a7c54ae43c5eccff06498d5cda2dce04fd11 (patch) | |
tree | bcc37b672009bc39f75203e43ce90bf623ddb8b8 /bltGrMarkerBitmap.C | |
parent | ae15b48311ab6c903ac2d0237ec48f3d6e4c76f4 (diff) | |
download | blt-4436a7c54ae43c5eccff06498d5cda2dce04fd11.zip blt-4436a7c54ae43c5eccff06498d5cda2dce04fd11.tar.gz blt-4436a7c54ae43c5eccff06498d5cda2dce04fd11.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'bltGrMarkerBitmap.C')
-rw-r--r-- | bltGrMarkerBitmap.C | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bltGrMarkerBitmap.C b/bltGrMarkerBitmap.C index da754bb..19fff04 100644 --- a/bltGrMarkerBitmap.C +++ b/bltGrMarkerBitmap.C @@ -45,6 +45,9 @@ static Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, &listObjOption, 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", NULL, -1, Tk_Offset(BitmapMarker, bitmap), TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_CUSTOM, "-coords", "coords", "Coords", + NULL, -1, Tk_Offset(BitmapMarker, worldPts), + TK_OPTION_NULL_OK, &coordsObjOption, MAP_ITEM}, {TK_OPTION_STRING, "-element", "element", "Element", NULL, -1, Tk_Offset(BitmapMarker, elemName), TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, -1, 0, 0, "-foreground", 0}, @@ -63,12 +66,8 @@ static Tk_OptionSpec optionSpecs[] = { "normal", -1, Tk_Offset(BitmapMarker, state), 0, &stateObjOption, 0}, {TK_OPTION_BOOLEAN, "-under", "under", "Under", "no", -1, Tk_Offset(BitmapMarker, drawUnder), 0, NULL, 0}, - {TK_OPTION_DOUBLE, "-x", "x", "X", - "0", -1, Tk_Offset(BitmapMarker, world.x), 0, NULL, 0}, {TK_OPTION_PIXELS, "-xoffset", "xOffset", "XOffset", "0", -1, Tk_Offset(BitmapMarker, xOffset), 0, NULL, 0}, - {TK_OPTION_DOUBLE, "-y", "y", "Y", - "0", -1, Tk_Offset(BitmapMarker, world.y), 0, NULL, 0}, {TK_OPTION_PIXELS, "-yoffset", "yOffset", "YOffset", "0", -1, Tk_Offset(BitmapMarker, yOffset), 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, -1, 0, 0, NULL, 0} @@ -163,10 +162,13 @@ static void MapBitmapProc(Marker* markerPtr) if (bmPtr->bitmap == None) return; + if (!bmPtr->worldPts || (bmPtr->worldPts->num < 1)) + return; + int width, height; Tk_SizeOfBitmap(graphPtr->display, bmPtr->bitmap, &width, &height); - Point2d anchorPt = Blt_MapPoint(&bmPtr->world, &markerPtr->axes); + Point2d anchorPt = Blt_MapPoint(bmPtr->worldPts->points, &markerPtr->axes); anchorPt = Blt_AnchorPoint(anchorPt.x, anchorPt.y, width, height, bmPtr->anchor); anchorPt.x += markerPtr->xOffset; |