Ejemplo n.º 1
0
 def hit_test(self, pos):
     plot = self.plot()
     if plot is None:
         return
     rect = self.get_text_rect()
     canvasRect = plot.canvas().contentsRect()
     xMap = plot.canvasMap(self.xAxis())
     yMap = plot.canvasMap(self.yAxis())
     x, y = self.get_top_left(xMap, yMap, canvasRect)
     rct = QRectF(x, y, rect.width(), rect.height())
     inside = rct.contains(pos.x(), pos.y())
     if inside:
         return self.click_inside(pos.x() - x, pos.y() - y)
     else:
         return 1000.0, None, False, None
Ejemplo n.º 2
0
 def hit_test(self, pos):
     plot = self.plot()
     if plot is None:
         return
     rect = self.get_text_rect()
     canvasRect = plot.canvas().contentsRect()
     xMap = plot.canvasMap(self.xAxis())
     yMap = plot.canvasMap(self.yAxis())
     x, y = self.get_top_left(xMap, yMap, canvasRect)
     rct = QRectF(x, y, rect.width(), rect.height())
     inside = rct.contains( pos.x(), pos.y())
     if inside:
         return self.click_inside(pos.x()-x, pos.y()-y)
     else:
         return 1000.0, None, False, None
Ejemplo n.º 3
0
 def get_text_rect(self):
     items = self.get_legend_items()
     TW, TH, _width, _height = self.get_legend_size(items)
     return QRectF(0.0, 0.0, TW, TH)
Ejemplo n.º 4
0
 def get_text_rect(self):
     sz = self.text.size()
     return QRectF(0, 0, sz.width(), sz.height())
Ejemplo n.º 5
0
 def get_text_rect(self):
     return QRectF(0.0, 0.0, 10., 10.)
Ejemplo n.º 6
0
def get_bbox(items):
    r = QRectF()
    for it in items:
        r = r.united(it.boundingRect())
    return r
Ejemplo n.º 7
0
 def __init__(self, xmin, xmax, ymin, ymax):
     super(MandelItem, self).__init__(np.zeros((1, 1), np.uint8))
     self.bounds = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax))
     self.update_border()
     self.IMAX = 80
     self.set_lut_range([0, self.IMAX])
Ejemplo n.º 8
0
def get_bbox(items):
    r = QRectF()
    for it in items:
        r = r.united(it.boundingRect())
    return r