mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:15:07 +00:00
Painter: Re-enable diagonal draw_line().
This code still needs clipping, but the basic concept works. It was disabled since before the kernel had floating point support.
This commit is contained in:
parent
a8c856ed3d
commit
f3aec1a0d9
3 changed files with 7 additions and 4 deletions
|
@ -91,4 +91,9 @@ double acos(double)
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double fabs(double value)
|
||||||
|
{
|
||||||
|
return value < 0 ? -value : value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ OPTIMIZATION_FLAGS = -Os
|
||||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
SERENITY_BASE_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
|
SERENITY_BASE_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
|
||||||
|
|
||||||
INCLUDE_FLAGS = -I$(SERENITY_BASE_DIR) -I. -I$(SERENITY_BASE_DIR)/LibC -I$(SERENITY_BASE_DIR)/Servers
|
INCLUDE_FLAGS = -I$(SERENITY_BASE_DIR) -I. -I$(SERENITY_BASE_DIR)/LibC -I$(SERENITY_BASE_DIR)/Servers -I$(SERENITY_BASE_DIR)/LibM
|
||||||
LDFLAGS = -L$(SERENITY_BASE_DIR)/LibC -L$(SERENITY_BASE_DIR)/LibCore -L$(SERENITY_BASE_DIR)/LibM -L$(SERENITY_BASE_DIR)/LibGUI
|
LDFLAGS = -L$(SERENITY_BASE_DIR)/LibC -L$(SERENITY_BASE_DIR)/LibCore -L$(SERENITY_BASE_DIR)/LibM -L$(SERENITY_BASE_DIR)/LibGUI
|
||||||
CLANG_FLAGS = -Wconsumed -m32 -ffreestanding -march=i686
|
CLANG_FLAGS = -Wconsumed -m32 -ffreestanding -march=i686
|
||||||
#SUGGEST_FLAGS = -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override #-Wsuggest-attribute=noreturn
|
#SUGGEST_FLAGS = -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override #-Wsuggest-attribute=noreturn
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
Painter::Painter(GraphicsBitmap& bitmap)
|
Painter::Painter(GraphicsBitmap& bitmap)
|
||||||
: m_target(bitmap)
|
: m_target(bitmap)
|
||||||
|
@ -511,9 +512,7 @@ void Painter::draw_line(const Point& p1, const Point& p2, Color color)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Implement clipping below.
|
// FIXME: Implement clipping below.
|
||||||
ASSERT_NOT_REACHED();
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
const double dx = point2.x() - point1.x();
|
const double dx = point2.x() - point1.x();
|
||||||
const double dy = point2.y() - point1.y();
|
const double dy = point2.y() - point1.y();
|
||||||
const double delta_error = fabs(dy / dx);
|
const double delta_error = fabs(dy / dx);
|
||||||
|
@ -529,7 +528,6 @@ void Painter::draw_line(const Point& p1, const Point& p2, Color color)
|
||||||
error -= 1.0;
|
error -= 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Painter::draw_focus_rect(const Rect& rect)
|
void Painter::draw_focus_rect(const Rect& rect)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue