freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] gsoc-anurag-2022 3d0e33d2a 23/27: Almost fix rendering


From: Werner Lemberg
Subject: [freetype2] gsoc-anurag-2022 3d0e33d2a 23/27: Almost fix rendering
Date: Mon, 3 Oct 2022 17:51:54 -0400 (EDT)

branch: gsoc-anurag-2022
commit 3d0e33d2aaff957a30a9c49985485d2930341de1
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>

    Almost fix rendering
---
 src/dense/ftdense.c | 24 +++++++++++++++---------
 1 file 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 )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]