Line Trace from cursor widget to world has some deviation

If that’s how it works then maybe you can set a variable to remember the cursor position before removing DPI scale, and use that for your trace instead.