Skip to content

Commit

Permalink
wxGUI/mapswipe: fix saving display to file (OSGeo#3185)
Browse files Browse the repository at this point in the history
* wxGUI/psmap: fix wx.adv.PseudoDC() class DrawRotatedText() method x, y
param arg int type
  • Loading branch information
tmszi authored and HuidaeCho committed Jan 9, 2024
1 parent 6b01841 commit 43625fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions gui/wxpython/mapwin/buffered.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,11 @@ def Draw(
pdc.SetTextBackground(img["background"])
coords, bbox = self.TextBounds(img)
if rotation == 0:
pdc.DrawText(img["text"], coords[0], coords[1])
pdc.DrawText(img["text"], int(coords[0]), int(coords[1]))
else:
pdc.DrawRotatedText(img["text"], coords[0], coords[1], rotation)
pdc.DrawRotatedText(
img["text"], int(coords[0]), int(coords[1]), rotation
)
pdc.SetIdBounds(drawid, bbox)

pdc.EndDrawing()
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/psmap/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ def DrawRotText(self, pdc, drawId, textDict, coords, bounds):
if rot == 0:
pdc.DrawLabel(text=textDict["text"], rect=bounds)
else:
pdc.DrawRotatedText(textDict["text"], coords[0], coords[1], rot)
pdc.DrawRotatedText(textDict["text"], int(coords[0]), int(coords[1]), rot)

pdc.SetIdBounds(drawId, Rect(*bounds))
self.Refresh()
Expand Down

0 comments on commit 43625fa

Please sign in to comment.