Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2841 +/- ##
==========================================
- Coverage 81.91% 81.72% -0.19%
==========================================
Files 326 326
Lines 55997 55700 -297
==========================================
- Hits 45868 45523 -345
- Misses 10129 10177 +48 |
Contributor
Author
|
@ales-erjavec, can you take a quick look? |
ales-erjavec
approved these changes
Jan 5, 2018
Orange/canvas/canvas/view.py
Outdated
| Canvas Graphics View | ||
| """ | ||
| import logging | ||
| from math import floor, copysign |
Orange/canvas/canvas/view.py
Outdated
| def wheelEvent(self, event: QWheelEvent): | ||
| # use mouse position as anchor while zooming | ||
| self.setTransformationAnchor(2) | ||
| if event.modifiers() & Qt.ControlModifier: |
Contributor
There was a problem hiding this comment.
... and event.buttons() == Qt.NoButtons:
| if event.modifiers() & Qt.ControlModifier: | ||
| delta = event.angleDelta().y() | ||
| if QT_VERSION >= 0x050300 \ | ||
| and event.source() != Qt.MouseEventNotSynthesized \ |
Contributor
There was a problem hiding this comment.
http://doc.qt.io/qt-5/qwheelevent.html#source says it was introduced in Qt 5.5.
Contributor
Author
There was a problem hiding this comment.
I changed this to 0x050500. The documentation for the corresponding enum says that the enum exists from 5.3. I don't know how would you get the source then.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Zooming is currently rather rigid. There is also no zooming out.
Description of changes
Add zooming by ⌘+scroll; zooming is continuous on trackpads, and discrete with mouse.
Add zooming by ⌘+ and ⌘- ,and reset by ⌘0.
Remove the zoom toggle button from the toolbar.
Includes