1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Added to display tests

This commit is contained in:
Ross Wilson
2015-08-23 17:26:50 +07:00
parent 7e7633bb59
commit 779091e4ca
2 changed files with 28 additions and 5 deletions

View File

@@ -162,7 +162,7 @@ class Display(_BufferedCanvas):
"""
self.drawlist.append((x1, y1, x2, y2, dotted))
log('Draw: x1,y1=%d,%d, x2,y2=%d,%d, dotted=%s' % (x1, y1, x2, y2, str(dotted)))
# log('Draw: x1,y1=%d,%d, x2,y2=%d,%d, dotted=%s' % (x1, y1, x2, y2, str(dotted)))
self.Update()
def clear(self):
@@ -182,10 +182,10 @@ class Display(_BufferedCanvas):
for (x1, y1, x2, y2, dotted) in self.drawlist:
if not dotted:
pen.SetStyle(wx.SOLID)
pen.SetWidth(2)
pen.SetWidth(1)
else:
pen.SetStyle(wx.DOT)
pen.SetWidth(3)
pen.SetWidth(2)
dc.SetPen(pen)
dc.DrawLine(x1, self.ScaleMaxY - y1,

View File

@@ -55,8 +55,31 @@ class TestFrame(wx.Frame):
self.Refresh()
self.display.draw(0, 0, 2047, 2047)
self.display.draw(2047, 0, 0, 2047, dotted=True)
self.display.draw(0, 0, 1024, 1024)
self.display.draw(1024, 0, 0, 1024)
self.display.draw(512, 0, 1024, 512)
self.display.draw(1024, 512, 512, 1024)
self.display.draw(512, 1024, 0, 512)
self.display.draw(0, 512, 512, 0)
# self.display.draw(0, 0, 1023, 1023)
# self.display.draw(1023, 0, 0, 1023)
# self.display.draw(511, 0, 1023, 511)
# self.display.draw(1023, 511, 511, 1023)
# self.display.draw(511, 1023, 0, 511)
# self.display.draw(0, 511, 511, 0)
for x in (0, 256, 512, 768, 1024):
self.display.draw(x, 0, x, 1024, dotted=True)
for y in (0, 256, 512, 768, 1024):
self.display.draw(0, y, 1024, y, dotted=True)
# for x in (0, 255, 511, 766, 1023):
# self.display.draw(x, 0, x, 1023, dotted=True)
#
# for y in (0, 255, 511, 766, 1023):
# self.display.draw(0, y, 1023, y, dotted=True)
def OnSize(self, event):
"""Maintain square window."""