Fixed the duplication of background layer: the flags aren't copied.

Minor changes.
This commit is contained in:
David Capello 2008-05-05 04:45:17 +00:00
parent cf3521dfe8
commit 3ce0a8fc85
7 changed files with 19 additions and 12 deletions

View File

@ -1,5 +1,8 @@
2008-05-05 David A. Capello <dacap@users.sourceforge.net> 2008-05-05 David A. Capello <dacap@users.sourceforge.net>
* src/commands/cmd_duplicate_layer.c (duplicate_layer): Fixed the
duplication of background layer: the flags aren't copied.
* src/script/functions.c (CropLayer): Rewritten (more simple). * src/script/functions.c (CropLayer): Rewritten (more simple).
(CropSprite): Fixed to crop the background layer right. (CropSprite): Fixed to crop the background layer right.

View File

@ -34,7 +34,7 @@
<key command="goto_next_layer" shortcut="Up" /> <key command="goto_next_layer" shortcut="Up" />
<!-- frame --> <!-- frame -->
<key command="new_frame" shortcut="N" /> <key command="new_frame" shortcut="N" />
<key command="frame_properties" shortcut="Shift+Ctrl+P" /> <key command="frame_properties" shortcut="P" />
<key command="goto_first_frame" shortcut="Home" /> <key command="goto_first_frame" shortcut="Home" />
<key command="goto_previous_frame" shortcut="Left" /> <key command="goto_previous_frame" shortcut="Left" />
<key command="goto_next_frame" shortcut="Right" /> <key command="goto_next_frame" shortcut="Right" />

View File

@ -1,7 +1,7 @@
<!-- ASE - Allegro Sprite Editor --> <!-- ASE - Allegro Sprite Editor -->
<!-- Copyright (C) 2001-2008 by David A. Capello --> <!-- Copyright (C) 2001-2008 by David A. Capello -->
<jinete> <jinete>
<window text="Tools Setup" name="configure_tool"> <window text="Tools Configuration" name="configure_tool">
<box vertical> <box vertical>
<box horizontal expansive> <box horizontal expansive>
<box vertical> <box vertical>

View File

@ -68,6 +68,8 @@ static Layer *duplicate_layer(void)
return NULL; return NULL;
} }
layer_copy->flags &= ~(LAYER_IS_LOCKMOVE | LAYER_IS_BACKGROUND);
sprintf(buf, "%s %s", layer_copy->name, _("Copy")); sprintf(buf, "%s %s", layer_copy->name, _("Copy"));
layer_set_name(layer_copy, buf); layer_set_name(layer_copy, buf);

View File

@ -1258,13 +1258,17 @@ void jwidget_scroll(JWidget widget, JRegion region, int dx, int dy)
{ {
if (dx != 0 || dy != 0) { if (dx != 0 || dy != 0) {
JRegion reg2 = jregion_new(NULL, 0); JRegion reg2 = jregion_new(NULL, 0);
jregion_copy(reg2, region); jregion_copy(reg2, region);
jregion_translate(reg2, dx, dy); jregion_translate(reg2, dx, dy);
jregion_intersect(reg2, reg2, region); jregion_intersect(reg2, reg2, region);
jregion_translate(reg2, -dx, -dy); jregion_translate(reg2, -dx, -dy);
jmouse_hide();
ji_move_region(reg2, dx, dy); ji_move_region(reg2, dx, dy);
jmouse_show();
jregion_translate(reg2, dx, dy); jregion_translate(reg2, dx, dy);
jregion_union(widget->update_region, widget->update_region, region); jregion_union(widget->update_region, widget->update_region, region);

View File

@ -161,9 +161,8 @@ void editor_set_scroll(JWidget widget, int x, int y, int use_refresh_region)
JRegion region = NULL; JRegion region = NULL;
int thick = editor->cursor_thick; int thick = editor->cursor_thick;
if (thick) { if (thick)
editor_clean_cursor(widget); editor_clean_cursor(widget);
}
if (use_refresh_region) { if (use_refresh_region) {
region = jwidget_get_drawable_region(widget, JI_GDR_CUTTOPWINDOWS); region = jwidget_get_drawable_region(widget, JI_GDR_CUTTOPWINDOWS);
@ -184,11 +183,9 @@ void editor_set_scroll(JWidget widget, int x, int y, int use_refresh_region)
jview_get_scroll(view, &new_scroll_x, &new_scroll_y); jview_get_scroll(view, &new_scroll_x, &new_scroll_y);
/* move screen with blits */ /* move screen with blits */
jmouse_hide();
jwidget_scroll(widget, region, jwidget_scroll(widget, region,
old_scroll_x - new_scroll_x, old_scroll_x - new_scroll_x,
old_scroll_y - new_scroll_y); old_scroll_y - new_scroll_y);
jmouse_show();
jregion_free(region); jregion_free(region);
/* editor->widget->flags &= ~JI_DIRTY; */ /* editor->widget->flags &= ~JI_DIRTY; */
@ -200,9 +197,8 @@ void editor_set_scroll(JWidget widget, int x, int y, int use_refresh_region)
/* } */ /* } */
/* } */ /* } */
if (thick) { if (thick)
editor_draw_cursor(widget, editor->cursor_screen_x, editor->cursor_screen_y); editor_draw_cursor(widget, editor->cursor_screen_x, editor->cursor_screen_y);
}
} }
void editor_update(JWidget widget) void editor_update(JWidget widget)

View File

@ -479,14 +479,16 @@ static void update_from_layer(StatusBar *statusbar)
} }
/* opacity layer */ /* opacity layer */
if (sprite && sprite->layer && if (sprite &&
sprite->layer->gfxobj.type == GFXOBJ_LAYER_IMAGE && sprite->layer &&
layer_is_image(sprite->layer) &&
!layer_is_background(sprite->layer) &&
(cel = layer_get_cel(sprite->layer, sprite->frame))) { (cel = layer_get_cel(sprite->layer, sprite->frame))) {
jslider_set_value(statusbar->slider, MID(0, cel->opacity, 255)); jslider_set_value(statusbar->slider, MID(0, cel->opacity, 255));
jwidget_enable(statusbar->slider); jwidget_enable(statusbar->slider);
} }
else { else {
jslider_set_value(statusbar->slider, 0); jslider_set_value(statusbar->slider, 255);
jwidget_disable(statusbar->slider); jwidget_disable(statusbar->slider);
} }
} }