This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 104718

Summary: API: Support for zoom in current cursor position
Product: platform Reporter: Sergey Petrov <sj-nb>
Component: GraphAssignee: issues@platform <issues>
Status: RESOLVED FIXED    
Severity: blocker Keywords: API_REVIEW_FAST
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 105060    
Attachments: Patch
Second Patch

Description Sergey Petrov 2007-05-24 12:11:57 UTC
I see only too zoom actions now, with top-left orientation and with center
orientation, In my opinion it's good to zoom using current mouse position as
center point.
Comment 1 David Kaspar 2007-05-28 15:39:26 UTC
ActionFactory.createMouseCenteredZoomAction method added. Also
test.zoom.MouseCenteredZoomTest example added.
Comment 2 David Kaspar 2007-05-28 15:40:06 UTC
Created attachment 42861 [details]
Patch
Comment 3 Sergey Petrov 2007-05-28 18:22:27 UTC
Sorry, it was my mistake about center point, it really should be mouse position
oriented but not centered, what I mean: point of scene below mouse should stay
below mouse position while zooming (if possible).

Suggested realization  sometimes works good, but try next use case:
1. zoom in to get scroll bars
2. scroll to right-bottom side of scene
3. move mouse pointer to left-top side of visible area
4. scroll wheel up-down a bit several times
zoom will not be changed but scene will be scrolled to mouse position, you can
even scroll to top-left side of the scene this way
Comment 4 David Kaspar 2007-05-29 08:56:16 UTC
My fault the previous behavior does not make much sense.
Attaching a new patch with mouse-oriented behavior.
Comment 5 David Kaspar 2007-05-29 08:56:48 UTC
Created attachment 42876 [details]
Second Patch
Comment 6 Sergey Petrov 2007-05-30 15:38:50 UTC
seems working in most cases,
-except some border effects caused by scene handling when zoom out (i.e. view
area don't show empty space behind "busy" area) - feature
-and strange shift when: zoom in, move to right-bottom edge, zoom out, scene
jumps from border, may be base reason the same as in first item, but In my
opinion it's a bug
Comment 7 David Kaspar 2007-06-05 09:49:36 UTC
Fixed in main trunk. Version 2.3.