Simplify `FlowGraphics.x_last()` logics
							parent
							
								
									e2cb1aca8e
								
							
						
					
					
						commit
						6df2c3d009
					
				| 
						 | 
					@ -158,7 +158,10 @@ class FlowGraphic(pg.GraphicsObject):
 | 
				
			||||||
        drawn yet, ``None``.
 | 
					        drawn yet, ``None``.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        '''
 | 
					        '''
 | 
				
			||||||
        return self._last_line.x1() if self._last_line else None
 | 
					        if self._last_line:
 | 
				
			||||||
 | 
					            return self._last_line.x1()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Curve(FlowGraphic):
 | 
					class Curve(FlowGraphic):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,7 +93,7 @@ class BarItems(FlowGraphic):
 | 
				
			||||||
    '''
 | 
					    '''
 | 
				
			||||||
    # XXX: causes this weird jitter bug when click-drag panning
 | 
					    # XXX: causes this weird jitter bug when click-drag panning
 | 
				
			||||||
    # where the path curve will awkwardly flicker back and forth?
 | 
					    # where the path curve will awkwardly flicker back and forth?
 | 
				
			||||||
    # cache_mode: int = QGraphicsItem.NoCache
 | 
					    cache_mode: int = QGraphicsItem.NoCache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(
 | 
					    def __init__(
 | 
				
			||||||
        self,
 | 
					        self,
 | 
				
			||||||
| 
						 | 
					@ -113,8 +113,9 @@ class BarItems(FlowGraphic):
 | 
				
			||||||
        '''
 | 
					        '''
 | 
				
			||||||
        if self._last_bar_lines:
 | 
					        if self._last_bar_lines:
 | 
				
			||||||
            close_arm_line = self._last_bar_lines[-1]
 | 
					            close_arm_line = self._last_bar_lines[-1]
 | 
				
			||||||
            return close_arm_line.x2() if close_arm_line else None
 | 
					            if close_arm_line:
 | 
				
			||||||
        else:
 | 
					                return close_arm_line.x2()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Qt docs: https://doc.qt.io/qt-5/qgraphicsitem.html#boundingRect
 | 
					    # Qt docs: https://doc.qt.io/qt-5/qgraphicsitem.html#boundingRect
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue