Skip to content

Commit

Permalink
Don't bother parsing integer because already integer
Browse files Browse the repository at this point in the history
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth

If offsetWidth is defined, it will already be an integer.
If offsetWidth is not defined, ig.system.realWidth will be used instead.
  • Loading branch information
Joncom committed Sep 13, 2019
1 parent 7ed8cde commit 823541c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/impact/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ig.Input = ig.Class.extend({


mousemove: function( event ) {
var internalWidth = parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth;
var internalWidth = ig.system.canvas.offsetWidth || ig.system.realWidth;
var scale = ig.system.scale * (internalWidth / ig.system.realWidth);

var pos = {left: 0, top: 0};
Expand Down

0 comments on commit 823541c

Please sign in to comment.