a more extensive clipping test

This commit is contained in:
Amy Bowersox 2019-12-10 15:00:51 -07:00
parent 02c8ede681
commit 59c8dcc638

View File

@ -3,19 +3,27 @@ import upiwin
hdc = upiwin.DevCtxt(type='screen')
hdc.text_color = 0xFFFFFF # white
hdc.rectangle(100, 100, 199, 199)
hdc.rectangle(99, 99, 200, 200)
clip = hdc.get_clip_rect()
hdc.set_clip_rect(100, 100, 200, 200)
hdc.text_color = 0x0000FF # red
hdc.move_to(50, 199)
hdc.line_to(199, 50)
hdc.move_to(50, 200)
hdc.line_to(200, 50)
hdc.text_color = 0x00FF00 # green
hdc.move_to(250, 199)
hdc.move_to(250, 200)
hdc.line_to(100, 50)
hdc.text_color = 0xFF0000 # blue
hdc.move_to(50, 100)
hdc.line_to(200, 250)
hdc.text_color = 0x00FFFF # yellow
hdc.move_to(250, 100)
hdc.line_to(100, 250)
hdc.set_clip_rect(clip[0], clip[1], clip[2], clip[3])
msg = {}