This commit is contained in:
@@ -20,8 +20,9 @@ import java.util.List;
|
||||
*/
|
||||
public class PuckGraphics {
|
||||
final static PointDouble labelPositionWithImage = new PointDouble(0.0, 36.0);
|
||||
Puck puck;
|
||||
Puck puck;
|
||||
final BasePlate basePlate ;
|
||||
final boolean rotated;
|
||||
final BasePlateGraphics basePlateGraphics;
|
||||
List<SampleGraphics> sampleGraphics = new ArrayList<>();
|
||||
|
||||
@@ -30,6 +31,7 @@ public class PuckGraphics {
|
||||
this.puck = puck;
|
||||
basePlate = puck.getBasePlate();
|
||||
this.basePlateGraphics = basePlateGraphics;
|
||||
this.rotated = (basePlateGraphics!=null);
|
||||
for (Sample sample : puck.getSamples()){
|
||||
sampleGraphics.add(new SampleGraphics(sample, this));
|
||||
}
|
||||
@@ -77,7 +79,7 @@ public class PuckGraphics {
|
||||
Point puckCenter = getDrawPosition();
|
||||
int puckDrawSize = getDrawSize();
|
||||
DimensionDouble puckSize = puck.getSize();
|
||||
PointDouble pos = getRotatedPosition(refPosition);
|
||||
PointDouble pos = rotated ? getRotatedPosition(refPosition) : refPosition;
|
||||
return new Point( (int) ((pos.x / puckSize.getWidth())* puckDrawSize/2 + puckCenter.x) ,
|
||||
(int) ((pos.y / puckSize.getHeight())* puckDrawSize/2 + puckCenter.y) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user