Skip to content

Commit

Permalink
Reset object colors now uses the right ball color
Browse files Browse the repository at this point in the history
  • Loading branch information
vorth committed Sep 2, 2024
1 parent 743312e commit 2c68e7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions core/src/main/java/com/vzome/core/editor/SymmetrySystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ public Direction createAnonymousOrbit( AlgebraicVector vector )
return orbit;
}

public Color getVectorColor( AlgebraicVector vector ) {
if( vector.isOrigin() ) {
return Color.WHITE;
public Color getVectorColor( AlgebraicVector vector )
{
if( vector == null || vector.isOrigin() ) {
return colors .getColor( Colors.CONNECTOR );
}
// try to get from cache
Axis line = this .vectorToAxis .get( vector.toString() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public Color apply( Manifestation man ) {

protected Color applyTo( Manifestation manifestation )
{
// SV 2024-09-02 - I think this can never be called, since all current subclasses override it

Color color = manifestation.getColor();
if( color == null ) { // TODO fix this! Should use techniques like SystemColorMap.
color = Color.WHITE; // provide default ball color so it can be manipulated
Expand Down Expand Up @@ -697,7 +699,7 @@ protected SystemColorMap(OrbitSource symmetry) {

@Override
protected Color applyToBall(Connector ball, int alpha) {
return Color.WHITE;
return symmetrySystem.getVectorColor( null );
}

@Override
Expand Down Expand Up @@ -797,7 +799,7 @@ protected Color applyToPanel(Panel panel, int alpha) {
@Override
protected Color applyToVector(AlgebraicVector vector) {
if(vector.isOrigin()) {
return Color.WHITE;
return symmetrySystem.getVectorColor( null ); // default ball color
}
Axis nearestSpecialOrbit = symmetrySystem.getSymmetry().getAxis(vector.toRealVector(), specialOrbits);
AlgebraicVector normal = nearestSpecialOrbit.normal();
Expand Down

0 comments on commit 2c68e7e

Please sign in to comment.