File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 8
8
#
9
9
# Based on Google's own Skia + SDL C++ example, chrome/m92:example/SkiaSDLExample.cpp
10
10
11
- # Notable difference with the c++ version:
11
+ # Notable difference (improvement!) with the c++ version:
12
12
# - The instructional text "Click and drag to create rects. Press esc to quit."
13
13
# is drawn so that its top left corner is the top left corner of the window.
14
14
# The original draws its *bottom* left corner somewhat arbitrarily at 100,100.
15
+ # - The rotating star is drawn at the centre, even if the window
16
+ # is resized. The original is at a fixed position relative to the bottom left corner.
15
17
16
18
from sdl2 import *
17
19
from sdl2 .video import *
@@ -209,7 +211,7 @@ def main(argv):
209
211
canvas .translate (0 , - (dh .value - state .window_height ))
210
212
211
213
canvas .save ()
212
- canvas .translate (dm . w / 2.0 , dm . h / 2.0 )
214
+ canvas .translate (state . window_width / 2.0 , dh . value - state . window_height / 2.0 )
213
215
canvas .rotate (rotation )
214
216
rotation += 1
215
217
canvas .drawImage (image , - 50.0 , - 50.0 )
You can’t perform that action at this time.
0 commit comments