Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8088198: Exception thrown from snapshot if dimensions are larger than max texture size #68

Closed
wants to merge 7 commits into from
@@ -1287,11 +1287,13 @@ static WritableImage doSnapshot(Scene scene,

int xMin = (int)Math.floor(x);
int yMin = (int)Math.floor(y);
int xMax = (int)Math.ceil(x + w);
int yMax = (int)Math.ceil(y + h);
int width = Math.max(xMax - xMin, 1);
int height = Math.max(yMax - yMin, 1);
int width;
int height;
if (wimg == null) {
int xMax = (int)Math.ceil(x + w);
int yMax = (int)Math.ceil(y + h);
width = Math.max(xMax - xMin, 1);
height = Math.max(yMax - yMin, 1);
wimg = new WritableImage(width, height);
} else {
width = (int)wimg.getWidth();
@@ -1310,7 +1312,8 @@ static WritableImage doSnapshot(Scene scene,
for (int j = 0; j < numVerticalTiles; j++) {
int yOffset = j * maxTextureSize;
int tileHeight = Math.min(maxTextureSize, height - yOffset);
This conversation was marked as resolved by fthevenet

This comment has been minimized.

Copy link
@arapte

arapte Jan 16, 2020

int xOffset = i * maxTextureSize;
int tileWidth = Math.min(maxTextureSize, width - xOffset);

These two lines should be moved to the outer loop of horizontal tabs.

This comment has been minimized.

Copy link
@fthevenet

fthevenet Jan 16, 2020

Author Contributor

done in 5019172

WritableImage tile = doSnapshotTile(scene, xMin + xOffset, yMin + yOffset, tileWidth, tileHeight, root, transform, depthBuffer, fill, camera, null);
WritableImage tile = doSnapshotTile(scene, xMin + xOffset, yMin + yOffset, tileWidth,
tileHeight, root, transform, depthBuffer, fill, camera, null);
wimg.getPixelWriter().setPixels(xOffset, yOffset, tileWidth, tileHeight, tile.getPixelReader(), 0, 0);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.