summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39ef03e)
raw | patch | inline | side by side (parent: 39ef03e)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 1 Sep 2008 20:54:33 +0000 (20:54 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 1 Sep 2008 20:54:33 +0000 (20:54 +0000) |
src/extension/internal/cairo-render-context.cpp | patch | blob | history |
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 4a3dd11a65abefac4fa6cd9cb5ef9429847f9b75..0a12a5c5bba60fa6621a69bab1caea75134de6dc 100644 (file)
@@ -976,10 +976,14 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
width_scaler *= 1.25;
height_scaler *= 1.25;
}
+
+#define SUBPIX_SCALE 1000
+
// Cairo requires an integer pattern surface width/height.
// Subtract 0.5 to prevent small rounding errors from increasing pattern size by one pixel.
- double surface_width = ceil(bbox_width_scaler * width_scaler * width - 0.5);
- double surface_height = ceil(bbox_height_scaler * height_scaler * height - 0.5);
+ // Multiply by SUBPIX_SCALE to allow for less than a pixel precision
+ double surface_width = MAX(ceil(SUBPIX_SCALE * bbox_width_scaler * width_scaler * width - 0.5), 1);
+ double surface_height = MAX(ceil(SUBPIX_SCALE * bbox_height_scaler * height_scaler * height - 0.5), 1);
TRACE(("surface size: %f x %f\n", surface_width, surface_height));
// create new rendering context
CairoRenderContext *pattern_ctx = cloneMe(surface_width, surface_height);