Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 498494

Summary: Mouse scroll zoom should be based on mouse location for an easier use instead of diagram editor view center
Product: [Modeling] Sirius Reporter: Pierre Guilet <pierre.guilet>
Component: DiagramAssignee: Pierre Guilet <pierre.guilet>
Status: CLOSED FIXED QA Contact: Julien Dupont <julien.dupont>
Severity: enhancement    
Priority: P3 CC: julien.dupont, laurent.redor, maxime.porhel, pierre-charles.david, steve.monnier
Version: 4.0.0Keywords: triaged
Target Milestone: 4.1.0   
Hardware: PC   
OS: Windows NT   
See Also: https://git.eclipse.org/r/68648
https://git.eclipse.org/r/78380
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=17f90cf7d90d3ba2861a7428e1e9640d7f842ec4
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=537883625c0e15b92b4e540f2df708ee72bb71ca
https://git.eclipse.org/r/80366
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=704da52f8cac23be9b6e90b820c1e75a273a2556
Whiteboard:
Attachments:
Description Flags
A project to test the zoom functionality none

Description Pierre Guilet CLA 2016-07-26 09:44:34 EDT
Created attachment 263314 [details]
A project to test the zoom functionality

Currently, the mouse scroll diagram zoom is applied on the diagram point behind the center of the visible editor view. This point is kept at center location of the view during the zoom.

So if we have a big diagram and we want to have a closer look at an element at the top left location of the view, then we have to zoom and scroll left and top to see the zoomed element.

This is not really user friendly as it is.

So we propose to enhance the diagram zooming functionality by applying the zoom on the diagram point behind the mouse location instead of the view center. The mouse is used to target a diagram point that must be zoom.

In this case, when zooming, the diagram point behind the mouse will be kept at the view center.

We don't have anymore to scroll after zooming because the element we wanted to have a closer look at have been kept in the view because it was close to the point from which we zoomed.

With this specification, if we have too zoom more than one time, we will have to readjust the mouse location to zoom on a diagram element between each zoom because the point behind the mouse is moved to the center of the view.

When using zoom by the tabbar dropdown menu, the mouse does not point any element in the diagram so we keep the current specification that is zooming to the diagram point behind the center of the visible view.
Comment 1 Eclipse Genie CLA 2016-08-03 05:39:58 EDT
New Gerrit change created: https://git.eclipse.org/r/78380
Comment 5 Pierre-Charles David CLA 2016-08-31 06:07:24 EDT
It looks like this broke the Zoom in/Zoom out tools in the palette:

1. open a diagram
2. select the Zoom in/"+" tool in the palette (not the tabbar)
3. click somehwere on the diagram

The diagram does not zoom, but an error appears in the error log:

java.lang.NullPointerException
	at org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart.zoomTo(DiagramRootEditPart.java:336)
	at org.eclipse.gmf.runtime.diagram.ui.internal.tools.ZoomTool.performMarqueeSelect(ZoomTool.java:159)
	at org.eclipse.gmf.runtime.diagram.ui.internal.tools.RubberbandSelectionTool.handleButtonUp(RubberbandSelectionTool.java:342)
	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
Comment 6 Eclipse Genie CLA 2016-09-05 04:11:09 EDT
New Gerrit change created: https://git.eclipse.org/r/80366
Comment 9 Pierre-Charles David CLA 2016-10-18 11:08:11 EDT
Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details.