summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-10 22:52:14 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-10 22:52:14 +0100
commit8626e95509c5984c331b23585bd530571239129d (patch)
tree8b76c96353796691740c91543153189a0e8afc93
parente180e2553ab70b0f5cac252ecb28b41c1c4bae81 (diff)
downloadserenity-8626e95509c5984c331b23585bd530571239129d.zip
Make Widgets/ build inside the kernel.
-rw-r--r--Kernel/kstdio.h2
-rw-r--r--Widgets/Painter.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/Kernel/kstdio.h b/Kernel/kstdio.h
index 4a6dbfb3f5..95f2b29948 100644
--- a/Kernel/kstdio.h
+++ b/Kernel/kstdio.h
@@ -1,3 +1,5 @@
#pragma once
#include "kprintf.h"
+
+#define printf dbgprintf
diff --git a/Widgets/Painter.cpp b/Widgets/Painter.cpp
index 9f6ba92992..a495dd9088 100644
--- a/Widgets/Painter.cpp
+++ b/Widgets/Painter.cpp
@@ -150,14 +150,14 @@ void Painter::drawLine(const Point& p1, const Point& p2, Color color)
if (x < m_clipRect.left() || x >= m_clipRect.right())
return;
if (point1.y() > point2.y())
- std::swap(point1, point2);
+ swap(point1, point2);
for (int y = max(point1.y(), m_clipRect.top()); y <= min(point2.y(), m_clipRect.bottom()); ++y)
m_target->scanline(y)[x] = color.value();
return;
}
if (point1.x() > point2.x())
- std::swap(point1, point2);
+ swap(point1, point2);
// Special case: horizontal line.
if (point1.y() == point2.y()) {
@@ -165,7 +165,7 @@ void Painter::drawLine(const Point& p1, const Point& p2, Color color)
if (y < m_clipRect.top() || y >= m_clipRect.bottom())
return;
if (point1.x() > point2.x())
- std::swap(point1, point2);
+ swap(point1, point2);
auto* pixels = m_target->scanline(point1.y());
for (int x = max(point1.x(), m_clipRect.left()); x <= min(point2.x(), m_clipRect.right()); ++x)
pixels[x] = color.value();
@@ -175,6 +175,7 @@ void Painter::drawLine(const Point& p1, const Point& p2, Color color)
// FIXME: Implement clipping below.
ASSERT_NOT_REACHED();
+#if 0
const double dx = point2.x() - point1.x();
const double dy = point2.y() - point1.y();
const double deltaError = fabs(dy / dx);
@@ -190,6 +191,7 @@ void Painter::drawLine(const Point& p1, const Point& p2, Color color)
error -= 1.0;
}
}
+#endif
}
void Painter::drawFocusRect(const Rect& rect)