[qet] [2110] revert the way of scaling operations before rev 2108 except for vertical and horizontal line |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2110
Author: blacksun
Date: 2013-04-14 21:36:02 +0200 (Sun, 14 Apr 2013)
Log Message:
-----------
revert the way of scaling operations before rev 2108 except for vertical and horizontal line
Modified Paths:
--------------
trunk/sources/editor/elementprimitivedecorator.cpp
Modified: trunk/sources/editor/elementprimitivedecorator.cpp
===================================================================
--- trunk/sources/editor/elementprimitivedecorator.cpp 2013-04-14 18:23:33 UTC (rev 2109)
+++ trunk/sources/editor/elementprimitivedecorator.cpp 2013-04-14 19:36:02 UTC (rev 2110)
@@ -32,10 +32,21 @@
*/
QRectF ElementPrimitiveDecorator::internalBoundingRect() const {
if (!decorated_items_.count() || !scene()) return(QRectF());
-
- QRectF rect = getSceneBoundingRect(decorated_items_.first() -> toItem());
+
+ //if @decorated_items_ contain one item and if this item is a vertical or horizontal partline, apply a specific methode
+ if ((decorated_items_.count() == 1) && (decorated_items_.first() -> xmlName() == "line")) {
+ QRectF horto = decorated_items_.first() -> sceneGeometricRect();
+ if (!horto.width() || !horto.height()) {
+ QRectF rect = getSceneBoundingRect(decorated_items_.first() -> toItem());
+ foreach (CustomElementPart *item, decorated_items_) {
+ rect = rect.united(getSceneBoundingRect(item -> toItem()));
+ }
+ return (rect);
+ }
+ }
+ QRectF rect = decorated_items_.first() -> sceneGeometricRect();
foreach (CustomElementPart *item, decorated_items_) {
- rect = rect.united(getSceneBoundingRect(item -> toItem()));
+ rect = rect.united(item -> sceneGeometricRect());
}
return(rect);
}