Files
test2/source
Lukas Tönne d27e0fcbaf Fix #130855: RegionView3D matrices need to be reset before transforming points
- In "Surface" mode the depth buffer needs to be cached after constructing the base DrawingPlacement, otherwise there is no depth data for projection and the origin is used as a fallback.
- The DrawingPlacement relies on the RegionView3D matrices to project from the rendered image back into 3D space. Because the boundary projection is called while the rv3d matrices are still set up for the image render it will look up the wrong pixels from the depth buffer. The solution is to make sure the viewport reset happens before projecting the boundary, i.e. by making sure the reset function is called before `process_image`.
- The aspect ratio needs to be taken into account for the boundary-to-strokes transform, otherwise the placement is wrong depending on how much the region aspect deviates from square.

The code for computing the zoom factor and offset has also been cleaned up and documented somewhat better, and now uses the `Bounds<float2>` struct instead of old `rctf`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131321
2025-01-10 12:17:38 +01:00
..