Added offset to label's y-pos so that the label does not overflow the image (#324)
This commit is contained in:
parent
4f84f68b96
commit
c88eb28e7c
@ -18,6 +18,7 @@ DEFAULT_SELECT_LINE_COLOR = QColor(255, 255, 255)
|
||||
DEFAULT_SELECT_FILL_COLOR = QColor(0, 128, 255, 155)
|
||||
DEFAULT_VERTEX_FILL_COLOR = QColor(0, 255, 0, 255)
|
||||
DEFAULT_HVERTEX_FILL_COLOR = QColor(255, 0, 0)
|
||||
MIN_Y_LABEL = 10
|
||||
|
||||
|
||||
class Shape(object):
|
||||
@ -124,6 +125,8 @@ class Shape(object):
|
||||
painter.setFont(font)
|
||||
if(self.label == None):
|
||||
self.label = ""
|
||||
if(min_y < MIN_Y_LABEL):
|
||||
min_y += MIN_Y_LABEL
|
||||
painter.drawText(min_x, min_y, self.label)
|
||||
|
||||
if self.fill:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user