diff options
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index d92d76e..d007f03 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -276,13 +276,8 @@ public: void invalidateCachedClipPathRecursively(bool childrenOnly = false, const QRectF &emptyIfOutsideThisRect = QRectF()); void updateCachedClipPathFromSetPosHelper(const QPointF &newPos); - inline bool isFullyTransparent() const - { return effectiveOpacity() < .001; } - - inline qreal effectiveOpacity() const { - if (!parent) - return opacity; - + inline qreal calcEffectiveOpacity() const + { qreal o = opacity; QGraphicsItem *p = parent; int myFlags = flags; @@ -303,6 +298,23 @@ public: return o; } + inline bool isFullyTransparent() const + { + if (opacity < 0.001) + return true; + if (!parent) + return false; + + return calcEffectiveOpacity() < 0.001; + } + + inline qreal effectiveOpacity() const { + if (!parent || !opacity) + return opacity; + + return calcEffectiveOpacity(); + } + inline bool childrenCombineOpacity() const { if (!children.size()) |