mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Fix issue w/ stroke not appearing when drawing past rect bounds
This commit is contained in:
parent
6fc6dd8dce
commit
7fa170ea16
2 changed files with 9 additions and 1 deletions
|
|
@ -781,7 +781,14 @@ class BeePathItem(BeeItemMixin, QtWidgets.QGraphicsItem):
|
|||
return self.boundingRect().contains(point)
|
||||
|
||||
def bounding_rect_unselected(self):
|
||||
return QtCore.QRectF(self._cached_rect)
|
||||
rect = QtCore.QRectF(self._cached_rect)
|
||||
if self.temp_stroke:
|
||||
base_size = self.temp_stroke.get('base_size', 10)
|
||||
for pt in self.temp_stroke.get('points', []):
|
||||
r = base_size * pt.get('pressure', 1.0) / 2 + 1
|
||||
rect = rect.united(QtCore.QRectF(
|
||||
pt['x'] - r, pt['y'] - r, 2 * r, 2 * r))
|
||||
return rect
|
||||
|
||||
def add_stroke(self, stroke):
|
||||
self.prepareGeometryChange()
|
||||
|
|
|
|||
|
|
@ -1001,6 +1001,7 @@ class BeeGraphicsView(MainControlsMixin,
|
|||
'y': round(local_pos.y(), 1),
|
||||
'pressure': self._tablet_pressure,
|
||||
})
|
||||
self.draw_item.prepareGeometryChange()
|
||||
self.draw_item.temp_stroke = self.draw_current_stroke
|
||||
self.draw_item.update()
|
||||
event.accept()
|
||||
|
|
|
|||
Loading…
Reference in a new issue