Page Menu
Home
Search
Configure Global Search
Log In
Paste
P2753
Frame Node label size enum test
Active
Public
Actions
Authored by
Leon Schittek (lone_noel)
on Jan 21 2022, 11:43 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 82da890fa9b..649a6c32103 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -2432,7 +2432,7 @@ static void frame_node_draw_label(const bNodeTree &ntree,
BLF_enable(fontid, BLF_ASPECT);
BLF_aspect(fontid, aspect, aspect, 1.0f);
/* clamp otherwise it can suck up a LOT of memory */
- BLF_size(fontid, MIN2(24.0f, font_size), U.dpi);
+ BLF_size(fontid, font_size, U.dpi);
/* title color */
int color_id = node_get_colorid(node);
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index adb6b1e4e34..4d270a3653d 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -421,6 +421,20 @@ const EnumPropertyItem rna_enum_node_map_range_items[] = {
{0, NULL, 0, NULL, NULL},
};
+const EnumPropertyItem rna_enum_frame_node_label_size[] = {
+ {12, "12", 0, "12", ""},
+ {18, "18", 0, "18", ""},
+ {24, "24", 0, "24", ""},
+ {36, "36", 0, "36", ""},
+ {48, "48", 0, "48", ""},
+ {60, "60", 0, "60", ""},
+ {72, "72", 0, "72", ""},
+ {96, "96", 0, "96", ""},
+ {144, "144", 0, "144", ""},
+ {288, "288", 0, "288", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
const EnumPropertyItem rna_enum_node_clamp_items[] = {
{NODE_CLAMP_MINMAX, "MINMAX", 0, "Min Max", "Constrain value between min and max"},
{NODE_CLAMP_RANGE,
@@ -4948,9 +4962,9 @@ static void def_frame(StructRNA *srna)
RNA_def_property_ui_text(prop, "Shrink", "Shrink the frame to minimal bounding box");
RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL);
- prop = RNA_def_property(srna, "label_size", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "label_size");
- RNA_def_property_range(prop, 8, 64);
+ prop = RNA_def_property(srna, "label_size", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "label_size");
+ RNA_def_property_enum_items(prop, rna_enum_frame_node_label_size);
RNA_def_property_ui_text(prop, "Label Font Size", "Font size to use for displaying the label");
RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL);
}
Event Timeline
Leon Schittek (lone_noel)
created this paste.
Jan 21 2022, 11:43 PM
Leon Schittek (lone_noel)
mentioned this in
T95105: Frame node: Increase font size range for label
.
Log In to Comment