Fixed line rendering in all projects

This commit is contained in:
Dawid Pietrykowski 2023-04-14 22:15:14 +02:00
parent 798bd4f5d4
commit ea02923498
4 changed files with 4 additions and 4 deletions

View File

@ -240,7 +240,7 @@ void MyWindow::DrawLine(int x1, int y1, int x2, int y2, QImage *img){
QColor color(255, 255, 255, 255); QColor color(255, 255, 255, 255);
if(abs(a) < 0.5f){ if(abs(a) < 1.0f){
for(int x = x1; x <= x2; x++){ for(int x = x1; x <= x2; x++){
int x_form = x - x1; int x_form = x - x1;
int y = a * x_form + y1; int y = a * x_form + y1;

View File

@ -226,7 +226,7 @@ void MyWindow::DrawLine(int x1, int y1, int x2, int y2, QImage *img){
QColor color(255, 255, 255, 255); QColor color(255, 255, 255, 255);
if(abs(a) < 0.5f){ if(abs(a) < 1.0f){
for(int x = x1; x <= x2; x++){ for(int x = x1; x <= x2; x++){
int x_form = x - x1; int x_form = x - x1;
int y = a * x_form + y1; int y = a * x_form + y1;

View File

@ -236,7 +236,7 @@ void MyWindow::DrawLine(int x1, int y1, int x2, int y2, bool update_temp){
QColor color(255, 255, 255, 255); QColor color(255, 255, 255, 255);
if(abs(a) < 0.5f){ if(abs(a) < 1.0f){
for(int x = x1; x <= x2; x++){ for(int x = x1; x <= x2; x++){
int x_form = x - x1; int x_form = x - x1;
int y = a * x_form + y1; int y = a * x_form + y1;

View File

@ -241,7 +241,7 @@ void MyWindow::DrawLine(int x1, int y1, int x2, int y2, QImage *img){
QColor color(255, 255, 255, 255); QColor color(255, 255, 255, 255);
if(abs(a) < 0.5f){ if(abs(a) < 1.0f){
for(int x = x1; x <= x2; x++){ for(int x = x1; x <= x2; x++){
int x_form = x - x1; int x_form = x - x1;
int y = a * x_form + y1; int y = a * x_form + y1;