summaryrefslogtreecommitdiffstats
path: root/src/pshinter
diff options
context:
space:
mode:
Diffstat (limited to 'src/pshinter')
-rw-r--r--src/pshinter/pshalgo.c94
-rw-r--r--src/pshinter/pshglob.c2
-rw-r--r--src/pshinter/pshpic.h8
3 files changed, 5 insertions, 99 deletions
diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index bfdb3ed..6e654cb 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -916,103 +916,9 @@
/*************************************************************************/
/*************************************************************************/
-#if 1
-
#define psh_corner_is_flat ft_corner_is_flat
#define psh_corner_orientation ft_corner_orientation
-#else
-
- FT_LOCAL_DEF( FT_Int )
- psh_corner_is_flat( FT_Pos x_in,
- FT_Pos y_in,
- FT_Pos x_out,
- FT_Pos y_out )
- {
- FT_Pos ax = x_in;
- FT_Pos ay = y_in;
-
- FT_Pos d_in, d_out, d_corner;
-
-
- if ( ax < 0 )
- ax = -ax;
- if ( ay < 0 )
- ay = -ay;
- d_in = ax + ay;
-
- ax = x_out;
- if ( ax < 0 )
- ax = -ax;
- ay = y_out;
- if ( ay < 0 )
- ay = -ay;
- d_out = ax + ay;
-
- ax = x_out + x_in;
- if ( ax < 0 )
- ax = -ax;
- ay = y_out + y_in;
- if ( ay < 0 )
- ay = -ay;
- d_corner = ax + ay;
-
- return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );
- }
-
- static FT_Int
- psh_corner_orientation( FT_Pos in_x,
- FT_Pos in_y,
- FT_Pos out_x,
- FT_Pos out_y )
- {
- FT_Int result;
-
-
- /* deal with the trivial cases quickly */
- if ( in_y == 0 )
- {
- if ( in_x >= 0 )
- result = out_y;
- else
- result = -out_y;
- }
- else if ( in_x == 0 )
- {
- if ( in_y >= 0 )
- result = -out_x;
- else
- result = out_x;
- }
- else if ( out_y == 0 )
- {
- if ( out_x >= 0 )
- result = in_y;
- else
- result = -in_y;
- }
- else if ( out_x == 0 )
- {
- if ( out_y >= 0 )
- result = -in_x;
- else
- result = in_x;
- }
- else /* general case */
- {
- long long delta = (long long)in_x * out_y - (long long)in_y * out_x;
-
- if ( delta == 0 )
- result = 0;
- else
- result = 1 - 2 * ( delta < 0 );
- }
-
- return result;
- }
-
-#endif /* !1 */
-
#ifdef COMPUTE_INFLEXS
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index 6723b71..4616bdc 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -339,7 +339,7 @@
bot = zone[1].org_bottom;
delta = bot - top;
- if ( delta < 2 * fuzz )
+ if ( delta / 2 < fuzz )
zone[0].org_top = zone[1].org_bottom = top + delta / 2;
else
{
diff --git a/src/pshinter/pshpic.h b/src/pshinter/pshpic.h
index 62de457..ca35cd6 100644
--- a/src/pshinter/pshpic.h
+++ b/src/pshinter/pshpic.h
@@ -20,8 +20,6 @@
#define __PSHPIC_H__
-FT_BEGIN_HEADER
-
#include FT_INTERNAL_PIC_H
@@ -33,6 +31,8 @@ FT_BEGIN_HEADER
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+FT_BEGIN_HEADER
+
typedef struct PSHinterPIC_
{
PSHinter_Interface pshinter_interface;
@@ -51,12 +51,12 @@ FT_BEGIN_HEADER
FT_Error
pshinter_module_class_pic_init( FT_Library library );
+FT_END_HEADER
+
#endif /* FT_CONFIG_OPTION_PIC */
/* */
-FT_END_HEADER
-
#endif /* __PSHPIC_H__ */