Fixed mark rounding

- Returning mark 2 as mark 1 breaks rounding calculations

#story[1195]
main
Connor Taylor-Brown 8 years ago
parent 0f316afb3c
commit 59bd22c2aa

@ -98,7 +98,7 @@ public class CompoundMark extends XMLCompoundMark{
* @return The second mark of the compound mark. * @return The second mark of the compound mark.
*/ */
public Mark getMark2() { public Mark getMark2() {
return mark2 == null? mark1 : mark2; return mark2;
} }

@ -255,7 +255,10 @@ public class RaceController extends Controller {
Material markColor = new PhongMaterial(new Color(0.15,0.9,0.2,1)); Material markColor = new PhongMaterial(new Color(0.15,0.9,0.2,1));
CompoundMark nextMark = boat.getCurrentLeg().getEndCompoundMark(); CompoundMark nextMark = boat.getCurrentLeg().getEndCompoundMark();
view3D.getShape(nextMark.getMark1().getSourceID()).setMaterial(markColor); view3D.getShape(nextMark.getMark1().getSourceID()).setMaterial(markColor);
view3D.getShape(nextMark.getMark2().getSourceID()).setMaterial(markColor); if(nextMark.getMark2() != null) {
view3D.getShape(nextMark.getMark2().getSourceID()).setMaterial(markColor);
}
boat.legProperty().addListener((o, prev, curr) -> swapColours(curr)); boat.legProperty().addListener((o, prev, curr) -> swapColours(curr));
} }
// Fix initial bird's-eye position // Fix initial bird's-eye position
@ -315,17 +318,22 @@ public class RaceController extends Controller {
CompoundMark end = leg.getEndCompoundMark(); CompoundMark end = leg.getEndCompoundMark();
Shape3D start1 = view3D.getShape(start.getMark1().getSourceID()); Shape3D start1 = view3D.getShape(start.getMark1().getSourceID());
Shape3D start2 = view3D.getShape(start.getMark2().getSourceID());
Shape3D end1 = view3D.getShape(end.getMark1().getSourceID()); Shape3D end1 = view3D.getShape(end.getMark1().getSourceID());
Shape3D end2 = view3D.getShape(end.getMark2().getSourceID());
Material nextMark = start1.getMaterial(); Material nextMark = start1.getMaterial();
Material lastMark = end1.getMaterial(); Material lastMark = end1.getMaterial();
start1.setMaterial(lastMark); start1.setMaterial(lastMark);
start2.setMaterial(lastMark); if(start.getMark2() != null) {
Shape3D start2 = view3D.getShape(start.getMark2().getSourceID());
start2.setMaterial(lastMark);
}
end1.setMaterial(nextMark); end1.setMaterial(nextMark);
end2.setMaterial(nextMark); if(end.getMark2() != null) {
Shape3D end2 = view3D.getShape(end.getMark2().getSourceID());
end2.setMaterial(nextMark);
}
} }
/** /**

Loading…
Cancel
Save