[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Wed Sep 19 20:46:49 CEST 2007
SVN commit 714512 by treat:
* Draw grips on top of object and makes sure they work
for the part of grip inside the items shape.
M +14 -8 viewitem.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #714511:714512
@@ -366,6 +366,7 @@
return itemShape();
QPainterPath selectPath;
+ selectPath.setFillRule(Qt::WindingFill);
#if INKSCAPE_MODE
selectPath.addPolygon(mapFromScene(selectBoundingRect()));
@@ -380,6 +381,13 @@
void ViewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+ Q_UNUSED(option);
+ Q_UNUSED(widget);
+
+ painter->setPen(pen());
+ painter->setBrush(brush());
+ paint(painter); //this is the overload that subclasses should use...
+
painter->save();
painter->setPen(Qt::DotLine);
if (isSelected() || isHovering() && parentView()->mouseMode() != View::Create) {
@@ -413,13 +421,6 @@
#endif
painter->restore();
- Q_UNUSED(option);
- Q_UNUSED(widget);
-
- painter->setPen(pen());
- painter->setBrush(brush());
- paint(painter); //this is the overload that subclasses should use...
-
// QGraphicsRectItem::paint(painter, option, widget);
}
@@ -1106,11 +1107,16 @@
//do not extend outside of parent.
//FIXME is the child rotated with respect to the parent is the real question...
- if (child->transform().isRotating()) {
+ if (child->transform().isRotating() /*|| child->lockAspectRatio()*/) {
dx = qMin(dx, dy);
dy = dx;
}
+// if (child->lockAspectRatio()) {
+// dx = qMax(dx, dy);
+// dy = dx;
+// }
+
QRectF rect = child->rect();
qreal width = rect.width() * dx;
More information about the Kst
mailing list