summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e4318d)
raw | patch | inline | side by side (parent: 5e4318d)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 5 Mar 2008 17:25:58 +0000 (17:25 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 5 Mar 2008 17:25:58 +0000 (17:25 +0000) |
src/display/sp-canvas.cpp | patch | blob | history |
index 88a4574907c2fba5a1d448b5877a3742cce0f5b2..b042f0d68ce96d76c581e65cde28df7d8d0b0734 100644 (file)
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;
&& 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;