Skip to content
Snippets Groups Projects
Commit 66fc5fb5 authored by Leonard Kupper's avatar Leonard Kupper
Browse files

Update from remote.

parents b5eac492 17a985a1
No related branches found
No related tags found
1 merge request!13Feat/rasterizer update 21
......@@ -45,7 +45,7 @@ public class FunctionalRasterizer<T extends Renderable> implements Rasterizer {
}
@SuppressWarnings("unchecked")
// This is allowed, because the code that calls the rasterize method does a lookup based on the diagram class beforehand
// This is allowed, because the code that calls the rasterize method does a lookup based on the renderable class beforehand
// and will only select the appropriate rasterizer. (See FunctionalRenderingBase)
// Since the FunctionalRasterizer is package private, there is no way to invoke it with the wrong type from 'outside'.
// Should somebody still force this to happen by intentional tampering, we have no choice but to catch this disgrace.
......
......@@ -34,6 +34,7 @@ public class RasterCanvas extends AbstractCanvas {
// Printing area rectangle
private Rectangle mPrintingAreaCells;
private Rectangle mPrintingAreaDots;
// Cell size
private int mCellWidth; // dots
......@@ -160,8 +161,9 @@ public class RasterCanvas extends AbstractCanvas {
mVerticalCellCount = mPrintingAreaCells.intWrapper().getBottom() + 1; // How many full cells fit vertically?
// To how many dots does this raster size correspond?
mColumnCount = mHorizontalCellCount * mCellWidth;
mRowCount = mVerticalCellCount * mCellHeight;
mPrintingAreaDots = toDotRectangle(mPrintingAreaCells);
mColumnCount = mPrintingAreaDots.intWrapper().getWidth();
mRowCount = mPrintingAreaDots.intWrapper().getHeight();
mLogger.trace("Determined raster dimensions (dots): {} columns x {} rows", mColumnCount, mRowCount);
}
......@@ -222,7 +224,7 @@ public class RasterCanvas extends AbstractCanvas {
return new Rectangle(mPrintingAreaCells);
}
public final Rectangle getDotRectangle() {
return toDotRectangle(mPrintingAreaCells);
return mPrintingAreaDots;
}
public final Rectangle toDotRectangle(final Rectangle cellRectangle) {
return cellRectangle.scaledBy(mCellWidth, mCellHeight);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment