Fix issue 401: Touchscreen adaptation for Caanoo and Wiz
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1659 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
7aefad850d
commit
e886553314
@ -1744,17 +1744,17 @@ void Compute_3_point_curve(short x1, short y1, short x4, short y4,
|
|||||||
float cx,cy; // Centre de (x1,y1) et (x4,y4)
|
float cx,cy; // Centre de (x1,y1) et (x4,y4)
|
||||||
float bx,by; // Intersect. des dtes ((x1,y1),(x2,y2)) et ((x3,y3),(x4,y4))
|
float bx,by; // Intersect. des dtes ((x1,y1),(x2,y2)) et ((x3,y3),(x4,y4))
|
||||||
|
|
||||||
cx=(float)(x1+x4)/2.0; // P1*--_ Légende:
|
cx=(float)(x1+x4)/2.0; // P1*--_ Legend:
|
||||||
cy=(float)(y1+y4)/2.0; // · \·· P2 -_\|/ : courbe
|
cy=(float)(y1+y4)/2.0; // · \·· P2 -_\|/ : curve
|
||||||
// · \ ·*· * : point important
|
// · \ ·*· * : important point
|
||||||
bx=cx+((8.0/3.0)*(Paintbrush_X-cx));// · | ·· · : pointillÚ
|
bx=cx+((8.0/3.0)*(Paintbrush_X-cx));// · | ·· · : dotted line
|
||||||
by=cy+((8.0/3.0)*(Paintbrush_Y-cy));// · |P ·· B
|
by=cy+((8.0/3.0)*(Paintbrush_Y-cy));// · |P ·· B
|
||||||
// C *·····*·········* P=Pos. du pinceau
|
// C *·····*·········* P=Pencil position
|
||||||
*x2=Round((bx+x1)/2.0); // · | ·· C=milieu de [P1,P4]
|
*x2=Round((bx+x1)/2.0); // · | ·· C=middle of [P1,P4]
|
||||||
*y2=Round((by+y1)/2.0); // · | ·· B=point tel que
|
*y2=Round((by+y1)/2.0); // · | ·· B=point computed as
|
||||||
// · / ·*· C->B=(8/3) * C->P
|
// · / ·*· C->B=(8/3) * C->P
|
||||||
*x3=Round((bx+x4)/2.0); // · _/·· P3 P2=milieu de [P1,B]
|
*x3=Round((bx+x4)/2.0); // · _/·· P3 P2=middle of [P1,B]
|
||||||
*y3=Round((by+y4)/2.0); // P4*-- P3=milieu de [P4,B]
|
*y3=Round((by+y4)/2.0); // P4*-- P3=middle of [P4,B]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1778,8 +1778,11 @@ void Curve_3_points_0_5(void)
|
|||||||
|
|
||||||
Compute_3_point_curve(x1,y1,x4,y4,&x2,&y2,&x3,&y3);
|
Compute_3_point_curve(x1,y1,x4,y4,&x2,&y2,&x3,&y3);
|
||||||
|
|
||||||
Hide_line_preview(x1,y1,x4,y4);
|
if (!Config.Stylus_mode)
|
||||||
Draw_curve_preview(x1,y1,x2,y2,x3,y3,x4,y4,color);
|
{
|
||||||
|
Hide_line_preview(x1,y1,x4,y4);
|
||||||
|
Draw_curve_preview(x1,y1,x2,y2,x3,y3,x4,y4,color);
|
||||||
|
}
|
||||||
|
|
||||||
if ( (Config.Coords_rel) && (Menu_is_visible) )
|
if ( (Config.Coords_rel) && (Menu_is_visible) )
|
||||||
{
|
{
|
||||||
@ -1798,17 +1801,19 @@ void Curve_3_points_0_5(void)
|
|||||||
Operation_push(y4);
|
Operation_push(y4);
|
||||||
Operation_push(Paintbrush_X);
|
Operation_push(Paintbrush_X);
|
||||||
Operation_push(Paintbrush_Y);
|
Operation_push(Paintbrush_Y);
|
||||||
|
|
||||||
|
if (Config.Stylus_mode)
|
||||||
|
{
|
||||||
|
Display_cursor();
|
||||||
|
while(!Mouse_K)
|
||||||
|
Get_input(20);
|
||||||
|
Hide_cursor();
|
||||||
|
|
||||||
|
Hide_line_preview(x1,y1,x4,y4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Curve_drag(void)
|
||||||
void Curve_3_points_0_11(void)
|
|
||||||
//
|
|
||||||
// Opération : OPERATION_3_POINTS_CURVE
|
|
||||||
// Click Souris: 0
|
|
||||||
// Taille_Pile : 11
|
|
||||||
//
|
|
||||||
// Souris effacée: Non
|
|
||||||
//
|
|
||||||
{
|
{
|
||||||
short x1,y1,x2,y2,x3,y3,x4,y4;
|
short x1,y1,x2,y2,x3,y3,x4,y4;
|
||||||
short old_x,old_y;
|
short old_x,old_y;
|
||||||
@ -1850,16 +1855,7 @@ void Curve_3_points_0_11(void)
|
|||||||
Operation_push(Paintbrush_X);
|
Operation_push(Paintbrush_X);
|
||||||
Operation_push(Paintbrush_Y);
|
Operation_push(Paintbrush_Y);
|
||||||
}
|
}
|
||||||
|
void Curve_finalize(void)
|
||||||
|
|
||||||
void Curve_3_points_12_11(void)
|
|
||||||
//
|
|
||||||
// Opération : OPERATION_3_POINTS_CURVE
|
|
||||||
// Click Souris: 1 ou 2
|
|
||||||
// Taille_Pile : 11
|
|
||||||
//
|
|
||||||
// Souris effacée: Oui
|
|
||||||
//
|
|
||||||
{
|
{
|
||||||
short x1,y1,x2,y2,x3,y3,x4,y4;
|
short x1,y1,x2,y2,x3,y3,x4,y4;
|
||||||
short old_x,old_y;
|
short old_x,old_y;
|
||||||
@ -1890,6 +1886,37 @@ void Curve_3_points_12_11(void)
|
|||||||
Wait_end_of_click();
|
Wait_end_of_click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Curve_3_points_0_11(void)
|
||||||
|
//
|
||||||
|
// Opération : OPERATION_3_POINTS_CURVE
|
||||||
|
// Click Souris: 0
|
||||||
|
// Taille_Pile : 11
|
||||||
|
//
|
||||||
|
// Souris effacée: Non
|
||||||
|
//
|
||||||
|
{
|
||||||
|
if (!Config.Stylus_mode)
|
||||||
|
Curve_drag();
|
||||||
|
else
|
||||||
|
Curve_finalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Curve_3_points_12_11(void)
|
||||||
|
//
|
||||||
|
// Opération : OPERATION_3_POINTS_CURVE
|
||||||
|
// Click Souris: 1 ou 2
|
||||||
|
// Taille_Pile : 11
|
||||||
|
//
|
||||||
|
// Souris effacée: Oui
|
||||||
|
//
|
||||||
|
{
|
||||||
|
if (!Config.Stylus_mode)
|
||||||
|
Curve_finalize();
|
||||||
|
else
|
||||||
|
Curve_drag();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////// OPERATION_AIRBRUSH
|
///////////////////////////////////////////////////////////// OPERATION_AIRBRUSH
|
||||||
|
|
||||||
|
|||||||
@ -433,6 +433,13 @@ int Load_INI(T_Config * conf)
|
|||||||
|
|
||||||
Line_number_in_INI_file=0;
|
Line_number_in_INI_file=0;
|
||||||
|
|
||||||
|
#if defined(__WIZ__) || defined(__CAANOO__)
|
||||||
|
conf->Stylus_mode = 1;
|
||||||
|
#else
|
||||||
|
conf->Stylus_mode = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// On alloue les zones de mémoire:
|
// On alloue les zones de mémoire:
|
||||||
buffer=(char *)malloc(1024);
|
buffer=(char *)malloc(1024);
|
||||||
filename=(char *)malloc(256);
|
filename=(char *)malloc(256);
|
||||||
|
|||||||
@ -350,6 +350,7 @@ typedef struct
|
|||||||
byte Grid_XOR_color; ///< XOR value to apply for grid color.
|
byte Grid_XOR_color; ///< XOR value to apply for grid color.
|
||||||
byte Right_click_colorpick; ///< Boolean, true to enable a "tablet" mode, where RMB acts as instant colorpicker
|
byte Right_click_colorpick; ///< Boolean, true to enable a "tablet" mode, where RMB acts as instant colorpicker
|
||||||
byte Sync_views; ///< Boolean, true when the Main and Spare should share their viewport settings.
|
byte Sync_views; ///< Boolean, true when the Main and Spare should share their viewport settings.
|
||||||
|
byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus.
|
||||||
} T_Config;
|
} T_Config;
|
||||||
|
|
||||||
// Structures utilisées pour les descriptions de pages et de liste de pages.
|
// Structures utilisées pour les descriptions de pages et de liste de pages.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user