Commit fa8a3bc9 authored by Raph Levien's avatar Raph Levien

Added tilt sensitivity in ink tool.

parent f552fa8a
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
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment