update to settings API
This commit is contained in:
parent
271e8228d6
commit
acdaec2bda
2 changed files with 6 additions and 6 deletions
|
@ -14,7 +14,7 @@ public class MovepositionCommand implements Command {
|
||||||
@Override
|
@Override
|
||||||
public void execute(Engine engine, State state, Settings settings) throws IOException {
|
public void execute(Engine engine, State state, Settings settings) throws IOException {
|
||||||
PositionElement.MovePosition movePosition = PositionElement.createMovePosition(mmToPt(settings.getAsFloat("x", 0f)),
|
PositionElement.MovePosition movePosition = PositionElement.createMovePosition(mmToPt(settings.getAsFloat("x", 0f)),
|
||||||
mmToPt(settings.getAsFloat("y", null)));
|
mmToPt(settings.getAsFloat("y", 0f)));
|
||||||
state.getElements().peek().add(movePosition);
|
state.getElements().peek().add(movePosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,15 +14,15 @@ public class TransformCommand implements Command {
|
||||||
public void execute(Engine engine, State state, Settings settings) throws IOException {
|
public void execute(Engine engine, State state, Settings settings) throws IOException {
|
||||||
TransformElement element = new TransformElement();
|
TransformElement element = new TransformElement();
|
||||||
if (settings.containsSetting("scalex") && settings.containsSetting("scaley")) {
|
if (settings.containsSetting("scalex") && settings.containsSetting("scaley")) {
|
||||||
element.setScale(settings.getAsFloat("scalex", null), settings.getAsFloat("scaley", null));
|
element.setScale(settings.getAsFloat("scalex", 1f), settings.getAsFloat("scaley", 1f));
|
||||||
}
|
}
|
||||||
if (settings.containsSetting("translatex") && settings.containsSetting("translatey")) {
|
if (settings.containsSetting("translatex") && settings.containsSetting("translatey")) {
|
||||||
element.setTranslate(mmToPt(settings.getAsFloat("translatex", null)),
|
element.setTranslate(mmToPt(settings.getAsFloat("translatex", 0f)),
|
||||||
mmToPt(settings.getAsFloat("translatey", null)));
|
mmToPt(settings.getAsFloat("translatey", 0f)));
|
||||||
}
|
}
|
||||||
if (settings.containsSetting("angle") && settings.containsSetting("rotatex") && settings.containsSetting("rotatey")) {
|
if (settings.containsSetting("angle") && settings.containsSetting("rotatex") && settings.containsSetting("rotatey")) {
|
||||||
element.setRotate(settings.getAsFloat("angle", null), mmToPt(settings.getAsFloat("rotatex", null)),
|
element.setRotate(settings.getAsFloat("angle", 0f), mmToPt(settings.getAsFloat("rotatex", 0f)),
|
||||||
mmToPt(settings.getAsFloat("rotatey", null)));
|
mmToPt(settings.getAsFloat("rotatey", 0f)));
|
||||||
}
|
}
|
||||||
state.getElements().peek().add(element);
|
state.getElements().peek().add(element);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue