summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnurag Thakur <anurag105csec21@bpitindia.edu.in>2022-09-14 20:34:48 +0530
committerAnurag Thakur <anurag105csec21@bpitindia.edu.in>2022-10-04 03:16:11 +0530
commit3d0e33d2aaff957a30a9c49985485d2930341de1 (patch)
tree02d794d704b4b8652b872b391d8a01ee1684b688
parentf6bd130ba3c9930031b2275202ef22ee991177ce (diff)
downloadfreetype2-3d0e33d2aaff957a30a9c49985485d2930341de1.tar.gz
Almost fix rendering
-rw-r--r--src/dense/ftdense.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/dense/ftdense.c b/src/dense/ftdense.c
index af52dbccf..dfd0f7417 100644
--- a/src/dense/ftdense.c
+++ b/src/dense/ftdense.c
@@ -67,13 +67,13 @@ swap( long int* a, long int* b )
void
-dense_render_line( dense_worker* worker, TPos to_x, TPos to_y )
+dense_render_line( dense_worker* worker, TPos tox, TPos toy )
{
// printf("line from: %d, %d to %d, %d\n", worker->prev_x, worker->prev_y,
// to_x, to_y);
- TPos from_x = worker->prev_x;
- TPos from_y = worker->prev_y;
- if ( from_y == to_y )
+ float from_x = worker->prev_x;
+ float from_y = worker->prev_y;
+ if ( from_y == toy )
return;
// aP0.m_x -= worker->m_origin_x;
@@ -81,12 +81,18 @@ dense_render_line( dense_worker* worker, TPos to_x, TPos to_y )
// aP1.m_x -= worker->m_origin_x;
// aP1.m_y -= worker->m_origin_y;
- from_x = TRUNC( (int)from_x );
- from_y = TRUNC( (int)from_y );
- to_x = TRUNC( (int)to_x );
- to_y = TRUNC( (int)to_y );
+ // from_x = TRUNC( (int)from_x );
+ // from_y = TRUNC( (int)from_y );
+ // to_x = TRUNC( (int)to_x );
+ // to_y = TRUNC( (int)to_y );
- // printf("line from: %d, %d to %d, %d\n", from_x, from_y, to_x, to_y);
+ from_x /= 256.0;
+ from_y /= 256.0;
+ float to_x = tox / 256.0;
+ float to_y = toy / 256.0;
+
+
+ //printf("line from: %f, %f to %f, %f\n", from_x, from_y, to_x, to_y);
float dir;
if ( from_y < to_y )