Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-08-27 23:02:33 +0300
committerHans Goudey <h.goudey@me.com>2021-08-27 23:02:33 +0300
commitf193cf66d46f133baa4b571e3dd64a171e207e62 (patch)
treedaea1bca72bb35876ef1789665c47accde4f4d81
parent1a0fed5d8ef701cb45845b4219ac3eb2e37e9703 (diff)
parent68efa935da0b42b43c8c683c01943498e1a1547e (diff)
Merge branch 'temp-geometry-nodes-fields' into temp-geometry-nodes-fields--fields
-rw-r--r--source/blender/blenkernel/intern/idprop.c4
-rw-r--r--source/blender/blenloader/intern/versioning_300.c3
-rw-r--r--source/blender/editors/space_action/action_draw.c24
-rw-r--r--source/blender/editors/space_node/node_draw.cc29
-rw-r--r--source/blender/editors/space_node/node_intern.h2
-rw-r--r--source/blender/makesrna/intern/rna_access.c4
6 files changed, 38 insertions, 28 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 786df14756a..f7411f541b7 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -1665,9 +1665,9 @@ IDPropertyUIData *IDP_ui_data_ensure(IDProperty *prop)
}
case IDP_UI_DATA_TYPE_INT: {
IDPropertyUIDataInt *ui_data = MEM_callocN(sizeof(IDPropertyUIDataInt), __func__);
- ui_data->min = -INT_MAX;
+ ui_data->min = INT_MIN;
ui_data->max = INT_MAX;
- ui_data->soft_min = -INT_MAX;
+ ui_data->soft_min = INT_MIN;
ui_data->soft_max = INT_MAX;
ui_data->step = 1;
prop->ui_data = (IDPropertyUIData *)ui_data;
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 0253316dc3a..2456b22f046 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -252,9 +252,6 @@ static void do_versions_idproperty_ui_data(Main *bmain)
ID *id;
FOREACH_MAIN_ID_BEGIN (bmain, id) {
IDProperty *idprop_group = IDP_GetProperties(id, false);
- if (idprop_group == NULL) {
- continue;
- }
version_idproperty_ui_data(idprop_group);
}
FOREACH_MAIN_ID_END;
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index a3bdcd2adf5..6f1a90e56a5 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -259,17 +259,18 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
else {
color = sel ? col1 : col2;
}
- /* frames less than one get less saturated background */
+
+ /* Color overlay on frames between the start/end frames. */
immUniformColor4ubv(color);
- immRectf(pos, 0.0f, ymin, v2d->cur.xmin, ymax);
+ immRectf(pos, ac->scene->r.sfra, ymin, ac->scene->r.efra, ymax);
- /* frames one and higher get a saturated background */
- immUniformColor3ubvAlpha(color, MIN2(255, color[3] * 2));
- immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax);
+ /* Color overlay outside the start/end frame range get a more transparent overlay. */
+ immUniformColor3ubvAlpha(color, MIN2(255, color[3] / 2));
+ immRectf(pos, v2d->cur.xmin, ymin, ac->scene->r.sfra, ymax);
+ immRectf(pos, ac->scene->r.efra, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax);
}
else if (ac->datatype == ANIMCONT_MASK) {
/* TODO: this is a copy of gpencil. */
- /* frames less than one get less saturated background */
uchar *color;
if (ale->type == ANIMTYPE_SUMMARY) {
color = col_summary;
@@ -277,12 +278,15 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
else {
color = sel ? col1 : col2;
}
+
+ /* Color overlay on frames between the start/end frames. */
immUniformColor4ubv(color);
- immRectf(pos, 0.0f, ymin, v2d->cur.xmin, ymax);
+ immRectf(pos, ac->scene->r.sfra, ymin, ac->scene->r.efra, ymax);
- /* frames one and higher get a saturated background */
- immUniformColor3ubvAlpha(color, MIN2(255, color[3] * 2));
- immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax);
+ /* Color overlay outside the start/end frame range get a more transparent overlay. */
+ immUniformColor3ubvAlpha(color, MIN2(255, color[3] / 2));
+ immRectf(pos, v2d->cur.xmin, ymin, ac->scene->r.sfra, ymax);
+ immRectf(pos, ac->scene->r.efra, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax);
}
}
}
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index b67117f1ad0..5b4e3b3b6f5 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -360,7 +360,11 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
/* Get "global" coordinates. */
float locx, locy;
node_to_view(node, 0.0f, 0.0f, &locx, &locy);
- float dy = locy;
+ /* Round the node origin because text contents are always pixel-aligned. */
+ locx = round(locx);
+ locy = round(locy);
+
+ int dy = locy;
/* Header. */
dy -= NODE_DY;
@@ -412,9 +416,9 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
/* Ensure minimum socket height in case layout is empty. */
buty = min_ii(buty, dy - NODE_DY);
- nsock->locx = locx + NODE_WIDTH(node);
- /* Place the socket circle in the middle of the layout. */
- nsock->locy = 0.5f * (dy + buty);
+ /* Round the socket location to stop it from jiggling. */
+ nsock->locx = round(locx + NODE_WIDTH(node));
+ nsock->locy = round(0.5f * (dy + buty));
dy = buty;
if (nsock->next) {
@@ -549,8 +553,8 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
buty = min_ii(buty, dy - NODE_DY);
nsock->locx = locx;
- /* Place the socket circle in the middle of the layout. */
- nsock->locy = 0.5f * (dy + buty);
+ /* Round the socket vertical position to stop it from jiggling. */
+ nsock->locy = round(0.5f * (dy + buty));
dy = buty - multi_input_socket_offset * 0.5;
if (nsock->next) {
@@ -587,6 +591,9 @@ static void node_update_hidden(bNode *node)
/* Get "global" coords. */
float locx, locy;
node_to_view(node, 0.0f, 0.0f, &locx, &locy);
+ /* Round the node origin because text contents are always pixel-aligned. */
+ locx = round(locx);
+ locy = round(locy);
/* Calculate minimal radius. */
LISTBASE_FOREACH (bNodeSocket *, nsock, &node->inputs) {
@@ -617,8 +624,9 @@ static void node_update_hidden(bNode *node)
LISTBASE_FOREACH (bNodeSocket *, nsock, &node->outputs) {
if (!nodeSocketIsHidden(nsock)) {
- nsock->locx = node->totr.xmax - hiddenrad + sinf(rad) * hiddenrad;
- nsock->locy = node->totr.ymin + hiddenrad + cosf(rad) * hiddenrad;
+ /* Round the socket location to stop it from jiggling. */
+ nsock->locx = round(node->totr.xmax - hiddenrad + sinf(rad) * hiddenrad);
+ nsock->locy = round(node->totr.ymin + hiddenrad + cosf(rad) * hiddenrad);
rad += drad;
}
}
@@ -628,8 +636,9 @@ static void node_update_hidden(bNode *node)
LISTBASE_FOREACH (bNodeSocket *, nsock, &node->inputs) {
if (!nodeSocketIsHidden(nsock)) {
- nsock->locx = node->totr.xmin + hiddenrad + sinf(rad) * hiddenrad;
- nsock->locy = node->totr.ymin + hiddenrad + cosf(rad) * hiddenrad;
+ /* Round the socket location to stop it from jiggling. */
+ nsock->locx = round(node->totr.xmin + hiddenrad + sinf(rad) * hiddenrad);
+ nsock->locy = round(node->totr.ymin + hiddenrad + cosf(rad) * hiddenrad);
rad += drad;
}
}
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index df20420e472..d35fd729131 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -328,7 +328,7 @@ extern const char *node_context_dir[];
#define BASIS_RAD (0.2f * U.widget_unit)
#define NODE_DYS (U.widget_unit / 2)
#define NODE_DY U.widget_unit
-#define NODE_SOCKDY (0.08f * U.widget_unit)
+#define NODE_SOCKDY (0.1f * U.widget_unit)
#define NODE_WIDTH(node) (node->width * UI_DPI_FAC)
#define NODE_HEIGHT(node) (node->height * UI_DPI_FAC)
#define NODE_MARGIN_X (1.10f * U.widget_unit)
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 2d6d5408aa0..a2905018cc7 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1333,7 +1333,7 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin
*hardmax = (float)ui_data->max;
}
else {
- *hardmin = FLT_MIN;
+ *hardmin = -FLT_MAX;
*hardmax = FLT_MAX;
}
return;
@@ -1377,7 +1377,7 @@ void RNA_property_float_ui_range(PointerRNA *ptr,
*precision = (float)ui_data->precision;
}
else {
- *softmin = FLT_MIN;
+ *softmin = -FLT_MAX;
*softmax = FLT_MAX;
*step = 1.0f;
*precision = 3.0f;