Bug 142751 - Zoom animation can take 32 seconds to complete
Summary: Zoom animation can take 32 seconds to complete
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal
Target Milestone: 1.0.1   Edit
Assignee: Syed Atif CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-05-19 10:27 EDT by Randy Hudson CLA
Modified: 2010-07-19 12:26 EDT (History)
1 user (show)

See Also:


Attachments
Patch that fixes the large number of steps in animating zoom change. (1.16 KB, patch)
2006-05-30 14:33 EDT, Syed Atif CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2006-05-19 10:27:35 EDT
For some reason our editor allows a zoom range of 5% to 400%. This might be a little broad, but changing from 5% to 400% takes 32 seconds to animate. The application stops responding in many cases until the end of the 32 seconds.

The problematic code seems to be:
private AnimationModel calculateAnimationModel(double zoom) {
  double dmod = zoom / getZoom();
  int steps = (int)Math.round(dmod > 0 ? dmod : 1/dmod);
  int duration = Math.max(DURATION_INCREMENT, steps * DURATION_INCREMENT);

Animations should never take longer than 250 milliseconds.

In the above code, 0 should probably be 1. Also, I would consider the following change:

double dmod = Math.sqrt(zoom/getZoom());
Comment 1 Steven R. Shaw CLA 2006-05-19 11:08:43 EDT
I think 250 milli is may be too short for large context changes.  But definitely 32 seconds is unacceptable... 
Comment 2 Syed Atif CLA 2006-05-26 16:49:17 EDT
sqrting the ratio is definitely better, but I think it still takes quite some time. In an ideal editor environment, I believe animations that take >1 seconds can become annoying especially if the corresponding feature has to be used frequently. How about:

double dmod = Math.pow(zoom / getZoom(),(double)1/8);
Comment 3 Syed Atif CLA 2006-05-30 14:33:07 EDT
Created attachment 43003 [details]
Patch that fixes the large number of steps in animating zoom change.
Comment 4 Syed Atif CLA 2006-07-18 11:16:25 EDT
patch committed for 1.0.100
Comment 5 Eclipse Webmaster CLA 2010-07-19 12:26:06 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug