Skip to content

Commit

Permalink
iterate over blockData.rtsc()
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Aug 27, 2023
1 parent 5a1d421 commit f49c29b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,11 @@ public <F extends BlockFactory<F>> double[] centerOfMass( final BlockData<M, Aff
final double[] c = new double[ 3 ];
int count = 0;

for ( final Entry<String, AffineModel2D> entry : models.entrySet() )
for ( final TileSpec ts : blockData.rtsc().getTileSpecs() )
{
final TileSpec ts = blockData.rtsc().getTileSpec( entry.getKey() );
final double[] coord = new double[] { (ts.getWidth() - 1) /2.0, (ts.getHeight() - 1) /2.0 };

entry.getValue().applyInPlace( coord );
models.get( ts.getTileId() ).applyInPlace( coord );

c[ 0 ] += coord[ 0 ];
c[ 1 ] += coord[ 1 ];
Expand Down

0 comments on commit f49c29b

Please sign in to comment.