forked from bartvdbraak/blender
UI: move layer up/down reverse into the operator
This commit is contained in:
parent
45881003f0
commit
6f6d76554f
@ -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()
|
||||
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user