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:
authorDalai Felinto <dfelinto@gmail.com>2016-10-13 19:42:54 +0300
committerDalai Felinto <dfelinto@gmail.com>2016-10-13 19:42:54 +0300
commitdfa5b32c8cc4f9df7da660754eae773f5df102e6 (patch)
tree73e32bbc235b36a991f722d589c00462fb7eee8b /source/blender/editors
parentecbedce81eb45e013ff03af64be9bc71c896e85b (diff)
parent625b504b23beb11e8a02408e7474e38fa525e8ee (diff)
Merge remote-tracking branch 'origin/master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_draw.c4
-rw-r--r--source/blender/editors/interface/interface_layout.c28
-rw-r--r--source/blender/editors/interface/resources.c4
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/space_file/fsmenu.c8
5 files changed, 30 insertions, 16 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index f8b98ebb8b7..33e44d73894 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -350,6 +350,10 @@ static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, flo
}
offset = -min_coord - range / 2.0f;
}
+ else if (max_coord == min_coord) {
+ factor = 1.0f;
+ offset = -min_coord;
+ }
}
BLI_assert(factor != 0.0f);
if (r_offset) {
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 976b5ed1193..875522e01c6 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -184,11 +184,8 @@ static const char *ui_item_name_add_colon(const char *name, char namestr[UI_MAX_
return name;
}
-static int ui_item_fit(int item, int pos, int all, int available, bool is_last, int alignment, int *offset)
+static int ui_item_fit(int item, int pos, int all, int available, bool is_last, int alignment)
{
- if (offset)
- *offset = 0;
-
/* available == 0 is unlimited */
if (available == 0)
return item;
@@ -2110,7 +2107,7 @@ static void ui_litem_layout_row(uiLayout *litem)
minw = ui_litem_min_width(itemw);
if (w - lastw > 0)
- neww = ui_item_fit(itemw, x, totw, w - lastw, !item->next, litem->alignment, NULL);
+ neww = ui_item_fit(itemw, x, totw, w - lastw, !item->next, litem->alignment);
else
neww = 0; /* no space left, all will need clamping to minimum size */
@@ -2144,12 +2141,12 @@ static void ui_litem_layout_row(uiLayout *litem)
if (item->flag) {
/* fixed minimum size items */
- itemw = ui_item_fit(minw, fixedx, fixedw, min_ii(w, fixedw), !item->next, litem->alignment, NULL);
+ itemw = ui_item_fit(minw, fixedx, fixedw, min_ii(w, fixedw), !item->next, litem->alignment);
fixedx += itemw;
}
else {
/* free size item */
- itemw = ui_item_fit(itemw, freex, freew, w - fixedw, !item->next, litem->alignment, NULL);
+ itemw = ui_item_fit(itemw, freex, freew, w - fixedw, !item->next, litem->alignment);
freex += itemw;
}
@@ -2469,7 +2466,7 @@ static void ui_litem_layout_column_flow(uiLayout *litem)
uiLayoutItemFlow *flow = (uiLayoutItemFlow *)litem;
uiItem *item;
int col, x, y, w, emh, emy, miny, itemw, itemh;
- int toth, totitem, offset;
+ int toth, totitem;
/* compute max needed width and total height */
toth = 0;
@@ -2491,22 +2488,27 @@ static void ui_litem_layout_column_flow(uiLayout *litem)
/* create column per column */
col = 0;
+ w = (litem->w - (flow->totcol - 1) * style->columnspace) / flow->totcol;
for (item = litem->items.first; item; item = item->next) {
- ui_item_size(item, NULL, &itemh);
- itemw = ui_item_fit(1, x - litem->x, flow->totcol, w, col == flow->totcol - 1, litem->alignment, &offset);
-
+ ui_item_size(item, &itemw, &itemh);
+
+ itemw = (litem->alignment == UI_LAYOUT_ALIGN_EXPAND) ? w : min_ii(w, itemw);
+
y -= itemh;
emy -= itemh;
- ui_item_position(item, x + offset, y, itemw, itemh);
+ ui_item_position(item, x, y, itemw, itemh);
y -= style->buttonspacey;
miny = min_ii(miny, y);
/* decide to go to next one */
if (col < flow->totcol - 1 && emy <= -emh) {
- x += itemw + style->columnspace;
+ x += w + style->columnspace;
y = litem->y;
emy = 0; /* need to reset height again for next column */
col++;
+
+ /* (< remaining width > - < space between remaining columns >) / <remamining columns > */
+ w = ((litem->w - (x - litem->x)) - (flow->totcol - col - 1) * style->columnspace) / (flow->totcol - col);
}
}
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 233406333f2..9d9cae6f347 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2767,6 +2767,10 @@ void init_userdef_do_versions(void)
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
rgba_char_args_set(btheme->tv3d.vertex_bevel, 0, 165, 255, 255);
rgba_char_args_set(btheme->tv3d.edge_bevel, 0, 165, 255, 255);
+
+ /* 3dView Keyframe Indicators */
+ btheme->tv3d.time_keyframe[3] = 0xFF;
+ btheme->tv3d.time_gp_keyframe[3] = 0xFF;
}
}
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 6f3694d1db8..0716c062ab9 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -442,7 +442,7 @@ static void add_gpencil_renderpass(OGLRender *oglrender, RenderResult *rr, Rende
if (BLI_listbase_is_empty(&gpd->layers)) {
return;
}
- if ((oglrender->v3d->flag2 & V3D_SHOW_GPENCIL) == 0) {
+ if (oglrender->v3d != NULL && (oglrender->v3d->flag2 & V3D_SHOW_GPENCIL) == 0) {
return;
}
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 72034b4f828..631ff06a77a 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -518,14 +518,18 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
CFURLEnumeratorRef volEnum = CFURLEnumeratorCreateForMountedVolumes(NULL, kCFURLEnumeratorSkipInvisibles, NULL);
while (result != kCFURLEnumeratorEnd) {
- unsigned char defPath[FILE_MAX];
+ char defPath[FILE_MAX];
result = CFURLEnumeratorGetNextURL(volEnum, &cfURL, NULL);
if (result != kCFURLEnumeratorSuccess)
continue;
CFURLGetFileSystemRepresentation(cfURL, false, (UInt8 *)defPath, FILE_MAX);
- fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)defPath, NULL, FS_INSERT_SORTED);
+
+ /* Add end slash for consistency with other platforms */
+ BLI_add_slash(defPath);
+
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, defPath, NULL, FS_INSERT_SORTED);
}
CFRelease(volEnum);