Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 694) +++ trunk/src/gui_act.c (revision 695) @@ -28,6 +28,7 @@ #include #include +#include #include #include "build_run.h" @@ -91,7 +92,7 @@ -static const char camv_acts_RotateLayer[] = "RotateLayer(@|idx, deg)"; +static const char camv_acts_RotateLayer[] = "RotateLayer(@|idx, [deg])"; static const char camv_acth_RotateLayer[] = "Rotates the layer addressed (@ for current) by deg degrees CCW. (The transformation is added to the current transformation matrix of the layer.)"; static fgw_error_t camv_act_RotateLayer(fgw_arg_t *res, int argc, fgw_arg_t *argv) { @@ -105,6 +106,14 @@ RND_ACT_CONVARG(2, FGW_DOUBLE, RotateLayer, deg = argv[2].val.nat_double); + if (deg == 0) { + char *rds = rnd_hid_prompt_for(hl, "Please rotation in degrees", "15", "rotate layer"); + deg = strtod(rds, NULL); + free(rds); + if (deg == 0) + return -1; + } + rnd_xform_mx_rotate(ly->mx, -deg); ly->enable_mx = 1; @@ -134,21 +143,29 @@ return FGW_SUCCESS; } -static const char camv_acts_ScaleLayer[] = "ScaleLayer(@|idx, sx[, sy])"; +static const char camv_acts_ScaleLayer[] = "ScaleLayer(@|idx, [sx, [sy]])"; static const char camv_acth_ScaleLayer[] = "Scales the layer addressed (@ for current) by the factor of sx and sy. If only sx is specified, it is used as sy as well. (The transformation is added to the current transformation matrix of the layer.)"; static fgw_error_t camv_act_ScaleLayer(fgw_arg_t *res, int argc, fgw_arg_t *argv) { rnd_design_t *hl = RND_ACT_DESIGN; camv_design_t *camv = (camv_design_t *)hl; - double sx, sy; + double sx = 0, sy; camv_layer_t *ly; int idx; get_layer(ly, idx, ScaleLayer); - RND_ACT_CONVARG(2, FGW_DOUBLE, ScaleLayer, sx = sy = argv[2].val.nat_double); + RND_ACT_MAY_CONVARG(2, FGW_DOUBLE, ScaleLayer, sx = sy = argv[2].val.nat_double); RND_ACT_MAY_CONVARG(3, FGW_DOUBLE, ScaleLayer, sy = argv[3].val.nat_double); + if (sx == 0) { + char *scs = rnd_hid_prompt_for(hl, "Please specify scale factor", "1.5", "scale layer"); + sx = sy = strtod(scs, NULL); + free(scs); + if (sx == 0) + return -1; + } + rnd_xform_mx_scale(ly->mx, sx, sy); ly->enable_mx = 1;