1.1 --- a/isac-java/src/java/isac/gui/mawen/editor/EventUtil.scala Thu Jul 06 16:10:42 2017 +0200
1.2 +++ b/isac-java/src/java/isac/gui/mawen/editor/EventUtil.scala Wed Aug 02 09:09:02 2017 +0200
1.3 @@ -38,21 +38,21 @@
1.4
1.5
1.6
1.7 -
1.8 - def doInBox(mousePos: Point, f: (Graphics, DrawBox) => Unit) : (Graphics, DrawBox) => Unit = {
1.9 -
1.10 + /*
1.11 + * return-value is stored in <code>foreachBoxFunction</code>
1.12 + */
1.13 + def doInBox(mousePos: Point, f: (Graphics, DrawBox) => Unit) :
1.14 + (Graphics, DrawBox) => Unit = {
1.15 (g: Graphics, box: DrawBox) => {
1.16 - val xfrom = box.x * Settings.zoom + Settings.translateX
1.17 - val xto = box.x * Settings.zoom + Settings.translateX + box.width * Settings.zoom
1.18 - val yfrom = box.y * Settings.zoom + Settings.translateY - box.height * Settings.zoom
1.19 - val yto = box.y * Settings.zoom + Settings.translateY
1.20 -
1.21 - if (xfrom < mousePos.x && xto > mousePos.x
1.22 - && yfrom < mousePos.y && yto > mousePos.y) {
1.23 -
1.24 - f(g, box)
1.25 - }
1.26 -
1.27 + val xfrom = box.x * Settings.zoom + Settings.translateX
1.28 + val xto = box.x * Settings.zoom + Settings.translateX
1.29 + + box.width * Settings.zoom
1.30 + val yfrom = box.y * Settings.zoom + Settings.translateY
1.31 + - box.height * Settings.zoom
1.32 + val yto = box.y * Settings.zoom + Settings.translateY
1.33 + if (xfrom < mousePos.x && xto > mousePos.x &&
1.34 + yfrom < mousePos.y && yto > mousePos.y)
1.35 + f(g, box)
1.36 }
1.37 }
1.38