示例#1
0
文件: label.py 项目: stonebig/guiqwt
 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
示例#2
0
文件: label.py 项目: mindw/guiqwt
 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
示例#3
0
文件: label.py 项目: mindw/guiqwt
 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)
示例#4
0
文件: label.py 项目: mindw/guiqwt
 def get_text_rect(self):
     sz = self.text.size()
     return QRectF(0, 0, sz.width(), sz.height())
示例#5
0
文件: label.py 项目: mindw/guiqwt
 def get_text_rect(self):
     return QRectF(0.0, 0.0, 10., 10.)
示例#6
0
def get_bbox(items):
    r = QRectF()
    for it in items:
        r = r.united(it.boundingRect())
    return r
示例#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])
示例#8
0
def get_bbox(items):
    r = QRectF()
    for it in items:
        r = r.united(it.boundingRect())
    return r