Skip to content

Commit

Permalink
Protect from null mouse wheel handler.
Browse files Browse the repository at this point in the history
Fixes #35.
  • Loading branch information
Jonathan Feinberg committed May 13, 2018
1 parent 68066cc commit 9529f5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = [Jonathan Feinberg](http://mrfeinberg.com/)
url = http://mrfeinberg.com/peasycam/
categories = 3D
sentence = A mouse driven camera-control library for 3D sketches.
version = 202
prettyVersion = 202
version = 301
prettyVersion = 301
minRevision = 227
maxRevision = 0
4 changes: 2 additions & 2 deletions src/peasy/PeasyCam.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
public class PeasyCam {

public final String VERSION = "210";
public final String VERSION = "301";

private static final Vector3D LOOK = Vector3D.plusK;
private static final Vector3D UP = Vector3D.plusJ;
Expand Down Expand Up @@ -334,7 +334,7 @@ public void mouseEvent(final MouseEvent e) {
break;

case MouseEvent.WHEEL:
if (insideViewport(p.mouseX, p.mouseY)) {
if (wheelHandler != null && insideViewport(p.mouseX, p.mouseY)) {
wheelHandler.handleWheel((int)e.getCount());
}
break;
Expand Down

0 comments on commit 9529f5d

Please sign in to comment.