Opened 5 years ago

Last modified 5 years ago

#11771 accepted defect

GraphicsContext.Rotate() moves origin

Reported by: steveward Owned by: csomor
Priority: normal Milestone:
Component: GUI-all Version: 2.8.10
Keywords: GraphicsContext Rotate Cc: ward@…
Blocked By: Blocking:
Patch: no

Description

Presumably GraphicsContext.Rotate(...) rotates the transform
about the origin (0,0), which should not move in subsequently
drawn graphics. The attached program (and screen shot) shows
that Rotate does move the origin by a few pixels.

The program paints a simple pattern centered on (0,0), performs
a rotation, then redisplays the pattern in a different color.
It then rotates and displays the pattern once more. As shown
in the screen shot, the patterns (after the first, red one)
are offset from the origin.

I've encountered this problem using the current OSX wxpython
distribution on an up-to-date Intel machine running OSX 10.6.2.

This may be related to the issue reported in ticket 11769; perhaps the tickets should be combined.

Attachments (2)

gcbug03.py download (2.3 KB) - added by steveward 5 years ago.
Test program demonstrating bug
gcbug03_pix.png download (18.6 KB) - added by steveward 5 years ago.
Screen shot from test pgm

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by steveward

Test program demonstrating bug

Changed 5 years ago by steveward

Screen shot from test pgm

comment:1 Changed 5 years ago by steveward

  • Component changed from wxPython to GUI-all

comment:2 Changed 5 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

Hi

interesting :-) you write that you scale to better see the effect, but actually I think that it is the scaling that triggers the bug, on MSW and OSX we try to draw solid lines so that they are really black, by offsetting them by 0.5 so that instead of having 0.5 on one side and 0.5 on the other, we get a full pixel, but I have forgotten to make this code 'scaling' proof

Thanks,

Stefan

comment:3 follow-up: Changed 5 years ago by SC

(In [63590]) translate 0.5 offset into user space before applying translation, see #11769, see #11771

comment:4 in reply to: ↑ 3 Changed 5 years ago by steveward

Replying to SC:

(In [63590]) translate 0.5 offset into user space before applying translation, see #11769, see #11771

Great - thanks to you both for your speedy attention to this -
and keep up the fine work!

  • Steve
Note: See TracTickets for help on using tickets.