mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01: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:
@@ -834,6 +834,12 @@ void DiagramView::scrollOnMovement(QKeyEvent *e)
|
|||||||
qreal elmt_bottom = y + qgi->boundingRect().bottom();
|
qreal elmt_bottom = y + qgi->boundingRect().bottom();
|
||||||
qreal elmt_right = x + qgi->boundingRect().right();
|
qreal elmt_right = x + qgi->boundingRect().right();
|
||||||
qreal elmt_left = x + qgi->boundingRect().left();
|
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_right_of_left_margin = elmt_left>=left;
|
||||||
bool elmt_left_of_right_margin = elmt_right<=right;
|
bool elmt_left_of_right_margin = elmt_right<=right;
|
||||||
|
|||||||
Reference in New Issue
Block a user