wangyao5 / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

[Patch] Zoom out still work inappropriately #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've updated achartengine to revision 376, but the zoom out function still 
doesn't work well. 

According to the new version of Zoom.java (the new approach for detecting 
limitsReachedX and limitsReachedY is elegant in my opinion), I wrote a patch to 
fix the problem.

Notice that this patch also enable users to zoom on X axis and Y axis 
independently, which hasn't been received.

For the normal version, try this (org.achartengine.tools.Zoom.java):

in apply() mehtod: 

        if (mZoomIn) {
          if (mRenderer.isZoomXEnabled()) {
            if (limitsReachedX && mZoomRate < 1) {  
              // ignore pinch zoom out once reached X limit
            } else {
              newWidth /= mZoomRate;
            }
          }

          if (mRenderer.isZoomYEnabled()) {
            if (limitsReachedY && mZoomRate < 1) {
            } else {
              newHeight /= mZoomRate;
            }
          }
        } else {
          if (mRenderer.isZoomXEnabled() && !limitsReachedX) {
            newWidth *= mZoomRate;
          }

          if (mRenderer.isZoomYEnabled() && !limitsReachedY) {
            newHeight *= mZoomRate;
          }
        }

Original issue reported on code.google.com by renws1990@gmail.com on 11 Mar 2012 at 4:56

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by renws1990@gmail.com on 11 Mar 2012 at 1:24