Page MenuHome

fix retina adjustment for sculpt/paint brush size
AbandonedPublic

Authored by Campbell Barton (campbellbarton) on May 31 2016, 11:04 PM.

Details

Summary

This is a fix for T48456, where retina displays image paint strokes are painted double the UnifiedBrushSize width (i.e. size * U.pixelsize). As a result there was no way to paint 1 pixel width strokes in the image editor.

It looks like the problem was that the sculpt/paint brush cursor effective area was "adjusted" for retina by inflating the effective size of the brush by U.pixelsize. However, this meant the smallest brush you could ever paint with was 1 * U.pixelsize.

My patch changes the way the brush is adjusted for retina, by instead making it inflate the drawn brush cursor by U.pixelsize. This way, the unified brush size is used directly for painting, and 1 pixel strokes come out 1 pixel large on retina machines.

Further, I believe this is the "correct" way to fix this issue, because it makes the unified brush size have the same meaning on retina and non-retina machines, and scales up the visual size of the cursor on retina machines, to account for the DPI difference.

  • Testing...

I tested this on my retina machine in UV paint, weight paint, and 3d texture paint, and it appears to work correctly now. It should not have any effect on non-retina machines, because on those machines U.pixelsize is 1, so this patch effectively removes a "* 1" and added a "/ 1" in a different place, neither of which should have any affect on non-retina machines.

I tested a textured brush, and a stenciled brush, and they also seems to work correctly.

  • Questions...

Are their other code paths that use the universal brush size that I should test?

Diff Detail

Repository
rB Blender

Event Timeline

David Jeske (jeske) retitled this revision from to fix retina adjustment for sculpt/paint brush size.
David Jeske (jeske) updated this object.
David Jeske (jeske) set the repository for this revision to rB Blender.
David Jeske (jeske) updated this object.
David Jeske (jeske) updated this object.
This revision is now accepted and ready to land.Jun 2 2016, 5:12 PM
This revision now requires review to proceed.Jun 2 2016, 5:12 PM