summaryrefslogtreecommitdiffstats
path: root/src/display/sp-canvas.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-03-05 17:25:58 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-03-05 17:25:58 +0000
commite9c2d8af25f4907d4b6d40eee9e5046de5892e06 (patch)
tree2fbe7fd8f100fae4c8e1a338ce7ac3b2a96beb10 /src/display/sp-canvas.cpp
parentBugfix for bug #168283: possible to create empty paths via text -> object to ... (diff)
downloadinkscape-e9c2d8af25f4907d4b6d40eee9e5046de5892e06.tar.gz
inkscape-e9c2d8af25f4907d4b6d40eee9e5046de5892e06.zip
fix 198818
(bzr r4968)
Diffstat (limited to 'src/display/sp-canvas.cpp')
-rw-r--r--src/display/sp-canvas.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 88a457490..b042f0d68 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1747,7 +1747,8 @@ faster.
The default for now is the strips mode.
*/
if (bw < bh || bh < 2 * TILE_SIZE) {
- int mid = (this_rect.x0 + this_rect.x1) / 2;
+ // to correctly calculate the mean of two ints, we need to sum them into a larger int type
+ int mid = ((long long) this_rect.x0 + (long long) this_rect.x1) / 2;
// Make sure that mid lies on a tile boundary
mid = (mid / TILE_SIZE) * TILE_SIZE;
@@ -1763,7 +1764,8 @@ The default for now is the strips mode.
&& sp_canvas_paint_rect_internal(setup, lo);
}
} else {
- int mid = (this_rect.y0 + this_rect.y1) / 2;
+ // to correctly calculate the mean of two ints, we need to sum them into a larger int type
+ int mid = ((long long) this_rect.y0 + (long long) this_rect.y1) / 2;
// Make sure that mid lies on a tile boundary
mid = (mid / TILE_SIZE) * TILE_SIZE;