Use a large rectangle for the picture bounds in RenderNodeLayer.drawLayer to prevent clipping #1090
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PictureRecorder.beginRecording
explicitly states that:It happens that on the desktop it is drawn, but then
drawPicture
legitimately assumes that it can ignore anything outside these bounds, so if the bounds of the picture don't intersect with the bounds of the canvas, nothing is drawn.Proposed Changes
Pass a large rectange to
PictureRecorder.beginRecording
. Note that it can't be too large due to a float overflow in Skia. I decided that ±2^30 is large enough for the XY plane, and leaves plenty of range for the scale "axis".Testing
Test: Tested manually all the scenarios reported in the various relevant tickets. Added two unit tests.
Issues Fixed
Fixes:
JetBrains/compose-multiplatform#2807
JetBrains/compose-multiplatform#3904
JetBrains/compose-multiplatform#1559
JetBrains/compose-multiplatform#2198