mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Merge pull request #320 from plc-user/master
Fix: Only scroll diagram-view, when moved text leaves visible area
This commit is contained in:
commit
1078496bb1
@ -834,6 +834,12 @@ void DiagramView::scrollOnMovement(QKeyEvent *e)
|
||||
qreal elmt_bottom = y + qgi->boundingRect().bottom();
|
||||
qreal elmt_right = x + qgi->boundingRect().right();
|
||||
qreal elmt_left = x + qgi->boundingRect().left();
|
||||
if (qgi->parentItem()) {
|
||||
elmt_top += qgi->parentItem()->y();
|
||||
elmt_bottom += qgi->parentItem()->y();
|
||||
elmt_right += qgi->parentItem()->x();
|
||||
elmt_left += qgi->parentItem()->x();
|
||||
}
|
||||
|
||||
bool elmt_right_of_left_margin = elmt_left>=left;
|
||||
bool elmt_left_of_right_margin = elmt_right<=right;
|
||||
|
Loading…
x
Reference in New Issue
Block a user