Page MenuHome

Preferences/Editing/Miscellaneous. Node Auto-offset Margin of type (PROP_PIXEL) 'px'?
ClosedPublic

Authored by Adrian Newton (TFS) on Mar 9 2020, 4:34 PM.

Diff Detail

Repository
rB Blender

Event Timeline

This revision is now accepted and ready to land.Mar 9 2020, 5:25 PM

The reason I initially didn't use PROP_PIXEL for node auto-offset was because DPI gets applied to it. So I'm not sure if we should actually do it, strictly speaking it's not a pixel value.

For the tile size this doesn't seem to be the case.

We have the same for other preferences like gizmo size.

I think it is a pixel size before DPI scaling, which isn't that different than an image size in pixels before zooming or DPI scaling.

I think that's fine as a definition, but we should probably make that explicit somewhere. Don't see a better place than the enum item definition for it, so would propose something like this:

1diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
2index 7a85f5c372f..66a5df001de 100644
3--- a/source/blender/makesrna/RNA_types.h
4+++ b/source/blender/makesrna/RNA_types.h
5@@ -121,6 +121,8 @@ typedef enum PropertySubType {
6 PROP_PASSWORD = 6,
7
8 /* numbers */
9+ /** A dimension in pixel units, possibly before DPI scaling (so value may not be the final pixel
10+ * value but the one to apply DPI scale to). */
11 PROP_PIXEL = 12,
12 PROP_UNSIGNED = 13,
13 PROP_PERCENTAGE = 14,

Adding a comment is fine with me.