mirror of https://github.com/GNOME/gimp.git
Added tilt sensitivity in ink tool.
This commit is contained in:
parent
f552fa8a78
commit
fa8a3bc922
|
@ -1,3 +1,8 @@
|
|||
Wed Nov 25 09:52:23 1998 Raph Levien <raph@gimp.org>
|
||||
|
||||
* app/ink.c (ink_pen_ellipse, create_ink_options): Added tilt
|
||||
sensitivity.
|
||||
|
||||
Mon Nov 23 06:44:10 PST 1998 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* applied gimp-stric-981116-1, lots o files changes in app. i18n
|
||||
|
|
23
app/ink.c
23
app/ink.c
|
@ -58,6 +58,7 @@ struct _InkOptions
|
|||
double aspect;
|
||||
double angle;
|
||||
double sensitivity;
|
||||
double tilt_sensitivity;
|
||||
};
|
||||
|
||||
typedef struct _BrushWidget BrushWidget;
|
||||
|
@ -201,6 +202,22 @@ create_ink_options ()
|
|||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->sensitivity);
|
||||
|
||||
/* tilt sens slider */
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
||||
label = gtk_label_new (_("Tilt Sensitivity:"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
|
||||
|
||||
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.0, 1.0, 0.01, 0.1, 0.0));
|
||||
slider = gtk_hscale_new (adj);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), slider, TRUE, TRUE, 0);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->tilt_sensitivity);
|
||||
|
||||
/* Brush shape widget */
|
||||
|
||||
brush_widget = g_new (BrushWidget, 1);
|
||||
|
@ -395,14 +412,16 @@ ink_pen_ellipse (gdouble x_center, gdouble y_center,
|
|||
double tsin, tcos;
|
||||
double aspect, radmin;
|
||||
double x,y;
|
||||
double tscale;
|
||||
|
||||
size = ink_options->size * (1 + ink_options->sensitivity * (2*pressure - 1));
|
||||
if (size*SUBSAMPLE < 1) size = 1/SUBSAMPLE;
|
||||
|
||||
/* Add brush angle/aspect to title vectorially */
|
||||
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*10.0;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*10.0;
|
||||
tscale = ink_options->tilt_sensitivity * 10.0;
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*tscale;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*tscale;
|
||||
aspect = sqrt(x*x+y*y);
|
||||
|
||||
if (aspect != 0)
|
||||
|
|
|
@ -58,6 +58,7 @@ struct _InkOptions
|
|||
double aspect;
|
||||
double angle;
|
||||
double sensitivity;
|
||||
double tilt_sensitivity;
|
||||
};
|
||||
|
||||
typedef struct _BrushWidget BrushWidget;
|
||||
|
@ -201,6 +202,22 @@ create_ink_options ()
|
|||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->sensitivity);
|
||||
|
||||
/* tilt sens slider */
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
||||
label = gtk_label_new (_("Tilt Sensitivity:"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
|
||||
|
||||
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.0, 1.0, 0.01, 0.1, 0.0));
|
||||
slider = gtk_hscale_new (adj);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), slider, TRUE, TRUE, 0);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->tilt_sensitivity);
|
||||
|
||||
/* Brush shape widget */
|
||||
|
||||
brush_widget = g_new (BrushWidget, 1);
|
||||
|
@ -395,14 +412,16 @@ ink_pen_ellipse (gdouble x_center, gdouble y_center,
|
|||
double tsin, tcos;
|
||||
double aspect, radmin;
|
||||
double x,y;
|
||||
double tscale;
|
||||
|
||||
size = ink_options->size * (1 + ink_options->sensitivity * (2*pressure - 1));
|
||||
if (size*SUBSAMPLE < 1) size = 1/SUBSAMPLE;
|
||||
|
||||
/* Add brush angle/aspect to title vectorially */
|
||||
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*10.0;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*10.0;
|
||||
tscale = ink_options->tilt_sensitivity * 10.0;
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*tscale;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*tscale;
|
||||
aspect = sqrt(x*x+y*y);
|
||||
|
||||
if (aspect != 0)
|
||||
|
|
|
@ -58,6 +58,7 @@ struct _InkOptions
|
|||
double aspect;
|
||||
double angle;
|
||||
double sensitivity;
|
||||
double tilt_sensitivity;
|
||||
};
|
||||
|
||||
typedef struct _BrushWidget BrushWidget;
|
||||
|
@ -201,6 +202,22 @@ create_ink_options ()
|
|||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->sensitivity);
|
||||
|
||||
/* tilt sens slider */
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
||||
label = gtk_label_new (_("Tilt Sensitivity:"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
|
||||
|
||||
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.0, 1.0, 0.01, 0.1, 0.0));
|
||||
slider = gtk_hscale_new (adj);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), slider, TRUE, TRUE, 0);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->tilt_sensitivity);
|
||||
|
||||
/* Brush shape widget */
|
||||
|
||||
brush_widget = g_new (BrushWidget, 1);
|
||||
|
@ -395,14 +412,16 @@ ink_pen_ellipse (gdouble x_center, gdouble y_center,
|
|||
double tsin, tcos;
|
||||
double aspect, radmin;
|
||||
double x,y;
|
||||
double tscale;
|
||||
|
||||
size = ink_options->size * (1 + ink_options->sensitivity * (2*pressure - 1));
|
||||
if (size*SUBSAMPLE < 1) size = 1/SUBSAMPLE;
|
||||
|
||||
/* Add brush angle/aspect to title vectorially */
|
||||
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*10.0;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*10.0;
|
||||
tscale = ink_options->tilt_sensitivity * 10.0;
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*tscale;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*tscale;
|
||||
aspect = sqrt(x*x+y*y);
|
||||
|
||||
if (aspect != 0)
|
||||
|
|
|
@ -58,6 +58,7 @@ struct _InkOptions
|
|||
double aspect;
|
||||
double angle;
|
||||
double sensitivity;
|
||||
double tilt_sensitivity;
|
||||
};
|
||||
|
||||
typedef struct _BrushWidget BrushWidget;
|
||||
|
@ -201,6 +202,22 @@ create_ink_options ()
|
|||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->sensitivity);
|
||||
|
||||
/* tilt sens slider */
|
||||
hbox = gtk_hbox_new (FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
|
||||
label = gtk_label_new (_("Tilt Sensitivity:"));
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
|
||||
|
||||
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.0, 1.0, 0.01, 0.1, 0.0));
|
||||
slider = gtk_hscale_new (adj);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), slider, TRUE, TRUE, 0);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
||||
|
||||
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
(GtkSignalFunc) ink_scale_update,
|
||||
&options->tilt_sensitivity);
|
||||
|
||||
/* Brush shape widget */
|
||||
|
||||
brush_widget = g_new (BrushWidget, 1);
|
||||
|
@ -395,14 +412,16 @@ ink_pen_ellipse (gdouble x_center, gdouble y_center,
|
|||
double tsin, tcos;
|
||||
double aspect, radmin;
|
||||
double x,y;
|
||||
double tscale;
|
||||
|
||||
size = ink_options->size * (1 + ink_options->sensitivity * (2*pressure - 1));
|
||||
if (size*SUBSAMPLE < 1) size = 1/SUBSAMPLE;
|
||||
|
||||
/* Add brush angle/aspect to title vectorially */
|
||||
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*10.0;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*10.0;
|
||||
tscale = ink_options->tilt_sensitivity * 10.0;
|
||||
x = ink_options->aspect*cos(ink_options->angle) + xtilt*tscale;
|
||||
y = ink_options->aspect*sin(ink_options->angle) + ytilt*tscale;
|
||||
aspect = sqrt(x*x+y*y);
|
||||
|
||||
if (aspect != 0)
|
||||
|
|
Loading…
Reference in New Issue