Changeset 1075
- Timestamp:
- 11/17/06 04:43:44 (2 years ago)
- Files:
-
- gaphas/trunk/gaphas/canvas.py (modified) (1 diff)
- gaphas/trunk/gaphas/item.py (modified) (4 diffs)
- gaphas/trunk/gaphas/solver.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphas/trunk/gaphas/canvas.py
r1065 r1075 324 324 @async(single=True, priority=PRIORITY_HIGH_IDLE) 325 325 def update(self): 326 """Update the can avs, if called from within a gtk-mainloop, the326 """Update the canvas, if called from within a gtk-mainloop, the 327 327 update job is scheduled as idle job. 328 328 """ gaphas/trunk/gaphas/item.py
r1045 r1075 336 336 - orthogonal (bool): wherther or not the line should be orthogonal 337 337 (only straight angles) 338 - horizontal: first line segment is horizontal 338 339 - line_width: width of the line to be drawn 339 340 … … 352 353 self.fuzzyness = 0 353 354 self._orthogonal = [] 355 self._horizontal = False 354 356 self._head_angle = self._tail_angle = 0 355 357 … … 373 375 add = self.canvas.solver.add_constraint 374 376 cons = self._orthogonal 377 rest = self._horizontal and 1 or 0 375 378 for pos, (h0, h1) in enumerate(zip(h, h[1:])): 376 if pos % 2 : # odd379 if pos % 2 == rest: # odd 377 380 cons.append(add(eq(a=h0.x, b=h1.x))) 378 381 else: … … 382 385 383 386 orthogonal = property(lambda s: s._orthogonal != [], _set_orthogonal) 387 388 def _set_horizontal(self, horizontal): 389 self._horizontal = horizontal 390 self._set_orthogonal(self._orthogonal) 391 392 horizontal = property(lambda s: s._horizontal != [], _set_horizontal) 384 393 385 394 def setup_canvas(self): gaphas/trunk/gaphas/solver.py
r998 r1075 59 59 def __float__(self): 60 60 return float(self._value) 61 62 def __eq__(self, other): 63 """ 64 >>> Variable(5) == 5 65 True 66 >>> Variable(5) == 4 67 False 68 >>> Variable(5) != 5 69 False 70 """ 71 return self._value.__eq__(float(other)) 72 73 def __ne__(self, other): 74 """ 75 >>> Variable(5) != 4 76 True 77 >>> Variable(5) != 5 78 False 79 """ 80 return self._value.__ne__(float(other)) 61 81 62 82 def __gt__(self, other):
