More explicit private var name
							parent
							
								
									948e133cae
								
							
						
					
					
						commit
						9f9b5480a6
					
				| 
						 | 
					@ -103,7 +103,7 @@ class Label:
 | 
				
			||||||
        self.fields = fields
 | 
					        self.fields = fields
 | 
				
			||||||
        self.orient_v = 'bottom'
 | 
					        self.orient_v = 'bottom'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self._af = self.txt.pos().x
 | 
					        self._anchor_func = self.txt.pos().x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # not sure if this makes a diff
 | 
					        # not sure if this makes a diff
 | 
				
			||||||
        self.txt.setCacheMode(QtGui.QGraphicsItem.DeviceCoordinateCache)
 | 
					        self.txt.setCacheMode(QtGui.QGraphicsItem.DeviceCoordinateCache)
 | 
				
			||||||
| 
						 | 
					@ -140,14 +140,14 @@ class Label:
 | 
				
			||||||
        func: Callable,
 | 
					        func: Callable,
 | 
				
			||||||
    ) -> None:
 | 
					    ) -> None:
 | 
				
			||||||
        assert isinstance(func(), float)
 | 
					        assert isinstance(func(), float)
 | 
				
			||||||
        self._af = func
 | 
					        self._anchor_func = func
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def set_view_y(
 | 
					    def set_view_y(
 | 
				
			||||||
        self,
 | 
					        self,
 | 
				
			||||||
        y: float,
 | 
					        y: float,
 | 
				
			||||||
    ) -> None:
 | 
					    ) -> None:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        scene_x = self._af() or self.txt.pos().x()
 | 
					        scene_x = self._anchor_func() or self.txt.pos().x()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # get new (inside the) view coordinates / position
 | 
					        # get new (inside the) view coordinates / position
 | 
				
			||||||
        self._view_xy = QPointF(
 | 
					        self._view_xy = QPointF(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue