MCPcopy Index your code
hub / github.com/adolfintel/NoteBot / mouseWheelMoved

Method mouseWheelMoved

StickyNotes/src/com/dosse/stickynotes/Note.java:352–363  ·  view source on GitHub ↗
(MouseWheelEvent e)

Source from the content-addressed store, hash-verified

350 //listener for ctrl+wheel (for zooming in and out)
351 text.addMouseWheelListener(new MouseWheelListener() {
352 @Override
353 public void mouseWheelMoved(MouseWheelEvent e) {
354 if (e.isControlDown() || e.isMetaDown()) { //scroll wheel with ctrl pressed (isMetaDown is for apple faggots)
355 if (e.getWheelRotation() < 0) {
356 setTextScale(textScale + 0.1f);
357 } else if (e.getWheelRotation() > 0) {
358 setTextScale(textScale - 0.1f);
359 }
360 } else { //scroll wheel without ctrl pressed simply scrolls
361 jScrollPane1.getMouseWheelListeners()[0].mouseWheelMoved(e);
362 }
363 }
364 });
365
366 //listener for ctrl+add, ctrl+minus, ctrl+NP0 (for zooming in and out)

Callers

nothing calls this directly

Calls 1

setTextScaleMethod · 0.95

Tested by

no test coverage detected