summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2008-12-19 19:10:23 +0100
committerKeith Packard <keithp@keithp.com>2009-01-09 10:59:05 -0800
commitffdf0139051c51f94d6a7a9a5fc2ccc68959d14b (patch)
tree1858eea627df443e1ec6a5ac238b0e0c0b15500b /hw
parent2a822c231145afd2b99498d5d4bf96be7dff92c5 (diff)
randr/xfree86: Fix a one off error in the panning calculations.
- Example: mode 1280x1024, panned area 1281x1024 panned_area.x2 = 1281 mode.width = 1280 If you substract 1280 from 1281, then that leaves you with one. Which is the one pixel that you need to move to actually see the last pixel collumn. Substracting 1 from this will consistently prevent you from seeing the right and bottom edge. (cherry picked from commit aedd2f566df585db7a1614f302cc8d3feda54275)
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/modes/xf86RandR12.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 362229c2f..eb6bf27bf 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -210,14 +210,14 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
}
/* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
- if (newX >= crtc->panningTotalArea.x2 - width)
- newX = crtc->panningTotalArea.x2 - width - 1;
+ if (newX > crtc->panningTotalArea.x2 - width)
+ newX = crtc->panningTotalArea.x2 - width;
if (newX < crtc->panningTotalArea.x1)
newX = crtc->panningTotalArea.x1;
}
if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
- if (newY >= crtc->panningTotalArea.y2 - height)
- newY = crtc->panningTotalArea.y2 - height - 1;
+ if (newY > crtc->panningTotalArea.y2 - height)
+ newY = crtc->panningTotalArea.y2 - height;
if (newY < crtc->panningTotalArea.y1)
newY = crtc->panningTotalArea.y1;
}