mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Allow ValueViewers to have a bounding box different from the Style's. This closes #64.
This commit is contained in:
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user