MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / setTranslation

Method setTranslation

src/main/java/fieldbox/boxes/Drawing.java:779–785  ·  view source on GitHub ↗

sets the translation of the canvas. Note, we defer actually handing this off to the graphics system (or getTranslation) until the next draw cycle. This way we do not get repaints during which the transformation changes half way through.

(Box root, Vec2 t)

Source from the content-addressed store, hash-verified

777 * which the transformation changes half way through.
778 */
779 public void setTranslation(Box root, Vec2 t) {
780 if (this.translation.distance(t) > 1e-10) {
781 dirty(root);
782 dirty(root, "glass");
783 }
784 this.translationNext = new Vec2(t);
785 }
786
787 /**
788 * sets the translation of the canvas. Note, we defer actually handing this off to the graphics system (or getTranslation) until the next draw cycle. This way we do not get repaints during

Callers 2

button2Method · 0.95
scrollForMouseEventMethod · 0.45

Calls 2

dirtyMethod · 0.95
distanceMethod · 0.45

Tested by

no test coverage detected