This commit is contained in:
gac-S_Changer
2018-08-23 13:57:32 +02:00
parent e41289c3c2
commit 62f6bb1aed

View File

@@ -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) );
}