keijiro / UITK-Scribble

Unity UI Toolkit sample: "Scribble" custom control
18 stars 5 forks source link

Viewport rect offset causes visual artifacts on wider aspect ratios #2

Open HG-Dev opened 1 month ago

HG-Dev commented 1 month ago

Screenshot 2024-10-03 184105

I recommend not using a relative viewport rect offset on the camera (currently x = 0.2) as it causes a difficult-to-debug visual artifact when the left pane does not cover the gap in the render. When combined with the scribble visual element, it also results in scribble portions that cannot be cleared.

雑談ですが, what does Graphics.DrawProceduralNow do? It's difficult to understand what it's connected to in the DrawLineSegment method, or how one might customize it to create a different shape of brush.

HG-Dev commented 3 weeks ago

As an exercise, I created a highly overengineered solution to the viewport rect issue through finding the negative space around opaque visual elements. Although the implementation is separated by asmdef, its bulk would probably distract from the real focus of the Scribble example... https://github.com/HG-Dev/UITK-ScribblePlus/tree/issue2_ui-space-minder

https://github.com/user-attachments/assets/7d63ace6-7e47-49a6-b45a-8a497328e878