Allow ValueViewers to have a bounding box different from the Style's. This closes #64.

This commit is contained in:
Twan van Laarhoven
2020-06-01 01:18:13 +02:00
parent e9305c7554
commit 4ff603d413
24 changed files with 79 additions and 87 deletions
-9
View File
@@ -189,15 +189,6 @@ int Style::update(Context& ctx) {
return changed;
}
bool Style::isVisible() const {
return visible
&& (width()) > 0
&& fabs(left()) < 100000
&& fabs(right()) < 100000
&& (height()) > 0
&& fabs(top()) < 100000
&& fabs(bottom()) < 100000;
}
bool Style::hasSize() const {
int h = is_setw(width) + is_set(left) + is_set(right);
int v = is_setw(height) + is_set(top) + is_set(bottom);
+3 -6
View File
@@ -118,15 +118,12 @@ public:
} automatic_side : 8; ///< Which of (left, width, right) and (top, height, bottom) is determined automatically?
bool content_dependent; ///< Does this style depend on content properties?
inline RealPoint getPos() const { return RealPoint(left, top ); }
inline RealSize getSize() const { return RealSize ( width, height); }
inline RealRect getExternalRect() const { return RealRect (left, top, width, height); }
inline RealRect getInternalRect() const { return RealRect(0, 0, width, height); }
inline RealPoint getPos() const { return RealPoint(left, top); }
inline RealSize getSize() const { return RealSize(width, height); }
inline RealRect getExternalRect() const { return RealRect(left, top, width, height); }
/// Does this style have a non-zero size (or is it scripted)?
bool hasSize() const;
/// Is this style visible, and does it have a sane size
bool isVisible() const;
/// Get a copy of this style
virtual StyleP clone() const = 0;