diff options
Diffstat (limited to 'src/sp-pattern.cpp')
| -rw-r--r-- | src/sp-pattern.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index cc82c637e..9aa54eadf 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -541,6 +541,16 @@ static bool pattern_hasItemChildren (SPPattern const *pat) return hasChildren; } +bool SPPattern::isValid() const +{ + double tile_width = pattern_width(this); + double tile_height = pattern_height(this); + + if (tile_width <= 0 || tile_height <= 0) + return false; + return true; +} + cairo_pattern_t* SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &bbox, double opacity) { bool needs_opacity = (1.0 - opacity) >= 1e-3; |
