diff --git a/ChangeLog b/ChangeLog index dc7937af5..72aa8aa08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-09-28 David A. Capello + + * src/modules/tools.c: Added new Curve tool. + (control_tool): Added support to lock lines in more + angles (feature request #1961397). + +2008-09-27 David A. Capello + + * src/widgets/colbar.c: Added support to drag & drop + colors (feature request #2109224). + 2008-05-06 David A. Capello * Version 0.6b2 released. diff --git a/NEWS.txt b/NEWS.txt index 82b08b0ae..12288c60a 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -5,6 +5,16 @@ NEWS 0.6 --- ++ Added 'Curve' tool (bezier-spline). ++ Added support to drag and drop colors in color-bar (feature request + feature #2109224). ++ Added support to lock lines in special angles with the Shift key, + useful to draw in isometric views (feature request #1961397). ++ Fixed bugs #1958760 and #1958932. + +0.6b2 +----- + + Added the `Background' layer. + Added support to load and save PNG files (through 'libpng'). + Transparent cel handling for the end-user (you can move a cel and diff --git a/data/gui-en.xml b/data/gui-en.xml index d55562ea0..a57bc2c9c 100644 --- a/data/gui-en.xml +++ b/data/gui-en.xml @@ -79,8 +79,10 @@ + + diff --git a/data/tips/tips.en b/data/tips/tips.en index 566954b9c..2b2a58b5c 100644 --- a/data/tips/tips.en +++ b/data/tips/tips.en @@ -5,7 +5,7 @@ \palette ase.pcx \image ase.pcx -Welcome to ASE 0.6 BETA 2 +Welcome to ASE 0.6 READ THIS! diff --git a/src/modules/gfx.c b/src/modules/gfx.c index 746158d39..6f7f0ab64 100644 --- a/src/modules/gfx.c +++ b/src/modules/gfx.c @@ -82,27 +82,9 @@ static void gen_gfx(void *data) int init_module_graphics(void) { -/* DIRS *dirs, *dir; */ -/* PALETTE pal; */ int c; - -/* dirs = filename_in_datadir("icons.pcx"); */ -/* for (dir=dirs; dir; dir=dir->next) { */ -/* set_color_conversion(COLORCONV_NONE); */ -/* icons_pcx = load_bitmap(dir->path, pal); */ -/* set_color_conversion(COLORCONV_TOTAL); */ - -/* if (icons_pcx) */ -/* break; */ -/* } */ -/* dirs_free(dirs); */ - -/* if (!icons_pcx) { */ -/* user_printf("Error loading icons.pcx"); */ -/* return -1; */ -/* } */ - for(c=0; cflags & TOOL_SNAP_ANGLES) - size = MAX(ABS(dx), ABS(dy)); - else - size = MIN(ABS(dx), ABS(dy)); - - x2 = x1 + SGN(dx) * size; - y2 = y1 + SGN(dy) * size; + int minsize = MIN(ABS(dx), ABS(dy)); + int maxsize = MAX(ABS(dx), ABS(dy)); if (tool->flags & TOOL_SNAP_ANGLES) { - if (ABS(dx) <= ABS(dy)/2) - x2 = x1; - else if (ABS(dy) <= ABS(dx)/2) + double angle = 180.0 * atan((double)-dy / (double)dx) / M_PI; + angle = ABS(angle); + + /* snap horizontally */ + if (angle < 18.0) { y2 = y1; + } + /* snap at 26.565 */ + else if (angle < 36.0) { + x2 = x1 + SGN(dx)*maxsize; + y2 = y1 + SGN(dy)*maxsize/2; + } + /* snap at 45 */ + else if (angle < 54.0) { + x2 = x1 + SGN(dx)*minsize; + y2 = y1 + SGN(dy)*minsize; + } + /* snap at 63.435 */ + else if (angle < 72.0) { + x2 = x1 + SGN(dx)*maxsize/2; + y2 = y1 + SGN(dy)*maxsize; + } + /* snap vertically */ + else { + x2 = x1; + } + } + else { + x2 = x1 + SGN(dx)*minsize; + y2 = y1 + SGN(dy)*minsize; } } @@ -1182,8 +1201,8 @@ next_pts:; pts[3] = pts[5] = pts[7] = y1; break; case 2: - pts[2] = x1; - pts[3] = y1; + pts[2] = pts[4] = x1; + pts[3] = pts[5] = y1; break; case 3: pts[4] = x1; @@ -1408,28 +1427,40 @@ next_pts:; /* update the state-bar */ if (jwidget_is_visible(statusbar)) { if (tool->flags & TOOL_UPDATE_BOX) { - char mode[256] = ""; + char extra[256] = ""; if (current_tool == tools_list[TOOL_MARKER]) { if (start_b & 1) { if (key_shifts & KB_ALT_FLAG) - strcat(mode, _("Replace")); + strcat(extra, _("Replace")); else - strcat(mode, _("Union")); + strcat(extra, _("Union")); } else { if (key_shifts & KB_ALT_FLAG) - strcat(mode, _("Intersect")); + strcat(extra, _("Intersect")); else - strcat(mode, _("Subtract")); + strcat(extra, _("Subtract")); } } + else if (current_tool == tools_list[TOOL_LINE]) { + usprintf(extra, "%s %.1f", + _("Angle"), + 180.0 * atan2(y1-y2, x2-x1) / M_PI); + } statusbar_set_text(statusbar, 0, "%s %3d %3d %s %3d %3d (%s %3d %3d) %s", _start, x1, y1, _end, x2, y2, - _size, ABS(x2-x1)+1, ABS(y2-y1)+1, mode); + _size, ABS(x2-x1)+1, ABS(y2-y1)+1, extra); + } + else if (tool->flags & TOOL_4FIRST2LAST) { + statusbar_set_text(statusbar, 0, "%s %3d %3d %s %3d %3d (%3d %3d - %3d %3d)", + _start, pts[0], pts[1], + _end, pts[6], pts[7], + pts[2], pts[3], + pts[4], pts[5]); } else { statusbar_set_text(statusbar, 0, "%s %3d %3d", _pos, x1, y1); @@ -1479,7 +1510,8 @@ next_pts:; if ((tool->flags & TOOL_4FIRST2LAST) && (curve_pts < 3)) { ++curve_pts; - click2 = MODE_CLICKANDCLICK; + editor_click_continue(widget, MODE_CLICKANDCLICK, + &start_x, &start_y); goto next_pts; } diff --git a/src/widgets/editor.h b/src/widgets/editor.h index 9b213b792..4bbc7028f 100644 --- a/src/widgets/editor.h +++ b/src/widgets/editor.h @@ -121,6 +121,7 @@ enum { }; void editor_click_start(JWidget editor, int mode, int *x, int *y, int *b); +void editor_click_continue(JWidget editor, int mode, int *x, int *y); void editor_click_done(JWidget editor); int editor_click(JWidget editor, int *x, int *y, int *update, void (*scroll_callback) (int before_change)); diff --git a/src/widgets/editor/click.c b/src/widgets/editor/click.c index 32561d011..d610685e7 100644 --- a/src/widgets/editor/click.c +++ b/src/widgets/editor/click.c @@ -65,6 +65,18 @@ void editor_click_start(JWidget widget, int mode, int *x, int *y, int *b) jwidget_capture_mouse(widget); } +void editor_click_continue(JWidget widget, int mode, int *x, int *y) +{ + click_mode = mode; + click_first = TRUE; + + click_start_x = click_last_x = jmouse_x(0); + click_start_y = click_last_y = jmouse_y(0); + click_start_b = click_last_b = click_prev_last_b; + + screen_to_editor(widget, click_start_x, click_start_y, x, y); +} + void editor_click_done(JWidget widget) { jwidget_release_mouse(widget);