Skip to content

Commit

Permalink
Merge pull request #143 from vlsi/text_zoom
Browse files Browse the repository at this point in the history
Fix text zoom when high-precision scrolling input is used
  • Loading branch information
deathmarine authored Aug 7, 2018
2 parents 6042502 + eade186 commit 2e89a3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/us/deathmarine/luyten/OpenFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ public int getSourceOffset() {
scrollPane.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
if (e.getWheelRotation() == 0) {
// Nothing to do here. This happens when scroll event is delivered from a touchbar
// or MagicMouse. There's getPreciseWheelRotation, however it looks like there's no
// trivial and consistent way to use that
// See https://github.com/JetBrains/intellij-community/blob/21c99af7c78fc82aefc4d05646389f4991b08b38/bin/idea.properties#L133-L156
return;
}

if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0) {
Font font = textArea.getFont();
Expand Down

0 comments on commit 2e89a3a

Please sign in to comment.