From: Digital X. <dig...@us...> - 2007-04-18 22:44:16
|
Update of /cvsroot/openrpg/openrpg1/orpg/mapper In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7116/orpg/mapper Modified Files: fog.py fog_handler.py Log Message: Fix so the fog handles edits while zoomed properly Index: fog.py =================================================================== RCS file: /cvsroot/openrpg/openrpg1/orpg/mapper/fog.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** fog.py 4 Apr 2007 01:16:47 -0000 1.35 --- fog.py 18 Apr 2007 22:44:15 -0000 1.36 *************** *** 229,233 **** if "__WXGTK__" not in wx.PlatformInfo: - #self.canvas.PrepareDC(dc) gc = wx.GraphicsContext.Create(dc) gc.SetBrush(wx.Brush(wx.BLACK)) --- 229,232 ---- *************** *** 239,243 **** rgn.SubtractRegion(self.fogregion) gc.ClipRegion(rgn) ! gc.DrawRectangle(topleft[0], topleft[1], size[0], size[1]) else: sc = dc.GetUserScale() --- 238,242 ---- rgn.SubtractRegion(self.fogregion) gc.ClipRegion(rgn) ! gc.DrawRectangle(0, 0, self.canvas.size[0]+2, self.canvas.size[1]+2) else: sc = dc.GetUserScale() *************** *** 320,323 **** --- 319,323 ---- for i in list: + print i.left, i.y, i.right if regn.IsEmpty(): if "__WXGTK__" not in wx.PlatformInfo: *************** *** 331,334 **** --- 331,335 ---- regn.Union(i.left, i.y, i.right+1-i.left, 1) + print self.log.log("Exit fog_layer->scanConvert(self, polypt)", ORPG_DEBUG) return regn Index: fog_handler.py =================================================================== RCS file: /cvsroot/openrpg/openrpg1/orpg/mapper/fog_handler.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** fog_handler.py 30 Mar 2007 19:47:51 -0000 1.15 --- fog_handler.py 18 Apr 2007 22:44:15 -0000 1.16 *************** *** 147,150 **** --- 147,152 ---- pos.x /= COURSE pos.y /= COURSE + pos.x /= scale + pos.y /= scale if evt.m_leftDown: *************** *** 156,160 **** pen.SetWidth(COURSE/2+1) dc.SetPen(pen) ! dc.DrawLine(self.last.x*COURSE, self.last.y*COURSE, pos.x*COURSE, pos.y*COURSE) dc.SetPen(wx.NullPen) self.line.append(IPoint().make(pos.x, pos.y)) --- 158,163 ---- pen.SetWidth(COURSE/2+1) dc.SetPen(pen) ! multi = scale*COURSE ! dc.DrawLine(self.last.x*multi, self.last.y*multi, pos.x*multi, pos.y*multi) dc.SetPen(wx.NullPen) self.line.append(IPoint().make(pos.x, pos.y)) *************** *** 179,190 **** dc.SetUserScale(scale,scale) pen= wx.Pen(self.pencolor) ! pen.SetWidth(COURSE*scale/2+1) dc.SetPen(pen) ! dc.DrawLine(self.last.x*COURSE,self.last.y*COURSE,self.line[0].X*COURSE,self.line[0].Y*COURSE) dc.SetPen(wx.NullPen) wx.BeginBusyCursor() # This prevents the divide by zero error by not even sending the line to be proccessed if it contains less then 3 points if (len(self.line)>1): ! self.canvas.layers['fog'].createregn(self.line,showmode) else: #print "Error Divide by zero, ignoring this section" --- 182,195 ---- dc.SetUserScale(scale,scale) pen= wx.Pen(self.pencolor) ! pen.SetWidth(COURSE/2+1) dc.SetPen(pen) ! dc.DrawLine(self.last.x*scale*COURSE,self.last.y*scale*COURSE,self.line[0].X*scale*COURSE,self.line[0].Y*scale*COURSE) dc.SetPen(wx.NullPen) wx.BeginBusyCursor() # This prevents the divide by zero error by not even sending the line to be proccessed if it contains less then 3 points if (len(self.line)>1): ! print self.line[0].X, self.line[0].Y ! print self.last ! self.canvas.layers['fog'].createregn(self.line, showmode) else: #print "Error Divide by zero, ignoring this section" |