[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2598 - trunk/src
From: |
jave27 |
Subject: |
[Pingus-CVS] r2598 - trunk/src |
Date: |
Tue, 17 Jan 2006 01:55:42 +0100 |
Author: jave27
Date: 2006-01-17 01:55:33 +0100 (Tue, 17 Jan 2006)
New Revision: 2598
Modified:
trunk/src/graphic_context_state.cxx
Log:
Fixed the "bouncing" issue when the screen resolution is bigger than the
level.
Modified: trunk/src/graphic_context_state.cxx
===================================================================
--- trunk/src/graphic_context_state.cxx 2006-01-17 00:11:52 UTC (rev 2597)
+++ trunk/src/graphic_context_state.cxx 2006-01-17 00:55:33 UTC (rev 2598)
@@ -153,6 +153,9 @@
void
GraphicContextState::set_pos(const CL_Pointf& pos)
{
+ float old_x = impl->offset.x;
+ float old_y = impl->offset.y;
+
impl->offset.x = -pos.x + (get_width()/2 / impl->zoom);
impl->offset.y = -pos.y + (get_height()/2 / impl->zoom);
@@ -160,20 +163,20 @@
{
if (-impl->offset.x < impl->limit.left)
{
- impl->offset.x = -impl->limit.left;
+ impl->offset.x = old_x;
}
else if (-impl->offset.x + get_width() >= impl->limit.right)
{
- impl->offset.x = -impl->limit.right + get_width()-1;
+ impl->offset.x = old_x;
}
if (-impl->offset.y < impl->limit.top)
{
- impl->offset.y = -impl->limit.top;
+ impl->offset.y = old_y;
}
else if (-impl->offset.y + get_height() >= impl->limit.bottom)
{
- impl->offset.y = -impl->limit.bottom + get_height()-1;
+ impl->offset.y = old_y;
}
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2598 - trunk/src,
jave27 <=