Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
94ff58e1aThis file is pinned to the selected release. Download the original to open it in your design tool.
package com.marginallyclever.makelangelo.makeart.turtletool;
import com.marginallyclever.makelangelo.Translator;
import com.marginallyclever.makelangelo.paper.Paper;
import com.marginallyclever.makelangelo.turtle.Turtle;
/**
* Crop a Turtle's drawing to fit within the Paper's margins.
*/
public class CropTurtleAction extends TurtleTool {
private final Paper paper;
public CropTurtleAction(Paper paper) {
super(Translator.get("CropTurtleAction"));
this.paper = paper;
}
@Override
public Turtle run(Turtle turtle) {
Turtle result = new Turtle(turtle);
CropTurtle.run(result, paper.getMarginRectangle());
return result;
}
}