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:
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py8
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c3
2 files changed, 4 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 192cacd6fea..f40307b5b11 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -376,12 +376,8 @@ class TOPBAR_PT_gpencil_layers(Panel):
col.separator()
sub = col.column(align=True)
- if reverse is False:
- sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP'
- sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN'
- else:
- sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'DOWN'
- sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'UP'
+ sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP'
+ sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN'
col.separator()
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index bfaf0ee2659..64cb91c3e14 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -338,7 +338,8 @@ static int gp_layer_move_exec(bContext *C, wmOperator *op)
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd);
- int direction = RNA_enum_get(op->ptr, "type");
+ const bool reverse = (bool)(U.gp_settings & GP_PAINT_REVERSE_LAYERS);
+ const int direction = RNA_enum_get(op->ptr, "type") * (reverse ? -1 : 1);
/* sanity checks */
if (ELEM(NULL, gpd, gpl))