dasher r3679 - trunk/Src/DasherCore
- From: pwelche svn gnome org
- To: svn-commits-list gnome org
- Subject: dasher r3679 - trunk/Src/DasherCore
- Date: Mon, 16 Mar 2009 16:02:06 +0000 (UTC)
Author: pwelche
Date: Mon Mar 16 16:02:06 2009
New Revision: 3679
URL: http://svn.gnome.org/viewvc/dasher?rev=3679&view=rev
Log:
One dimensional mode makes it easy to place the cursor exactly on the
cross hairs, so "don't zoom". (r3678)
Modified:
trunk/Src/DasherCore/DasherModel.cpp
Modified: trunk/Src/DasherCore/DasherModel.cpp
==============================================================================
--- trunk/Src/DasherCore/DasherModel.cpp (original)
+++ trunk/Src/DasherCore/DasherModel.cpp Mon Mar 16 16:02:06 2009
@@ -419,6 +419,15 @@
int iTargetMin(Mousey - ((myint)iMaxY * Mousex) / (2 * (myint)iOX));
int iTargetMax(Mousey + ((myint)iMaxY * Mousex) / (2 * (myint)iOY));
+ // If (0,iMaxY) = (iTargetMin,iTargetMax), the "zoom factor" is 1, we
+ // don't want to do anything.
+ if (0 == iTargetMin && iMaxY == iTargetMax)
+ {
+ iNewMin = m_Rootmin;
+ iNewMax = m_Rootmax;
+ return;
+ }
+
// Compute the point C which is thus the center of expansion
// (it divides iTargetMin-Max into the same proportions at it divides 0-iMaxY)
const dasherint C = (iTargetMin * iMaxY) / (iTargetMin + iMaxY - iTargetMax);
@@ -998,6 +1007,10 @@
y1 -= ds;
y2 += ds;
+ // If (y1,y2) = (Y1,Y2), the "zoom factor" is 1, we don't want to do
+ // anything.
+ if (y1 == Y1 && y2 == Y2) return;
+
// There is a point C on the y-axis such the ratios (y1-C):(Y1-C) and
// (y2-C):(Y2-C) are equal. (Obvious when drawn on separate parallel axes.)
// (Y2 - Y1 is large.)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]