#include <cmath>
#include <cstdlib>
#include <cstring>
+#include <utility>
#include <cairo.h>
#include <gio/gio.h>
gint slope1_x;
gint slope1_y;
gint y;
- gint t;
gboolean middle = FALSE;
if (!pb) return;
if (y1 > y2)
{
- t = x1; x1 = x2; x2 = t;
- t = y1; y1 = y2; y2 = t;
+ std::swap(x1, x2);
+ std::swap(y1, y2);
}
if (y2 > y3)
{
- t = x2; x2 = x3; x3 = t;
- t = y2; y2 = y3; y3 = t;
+ std::swap(x2, x3);
+ std::swap(y2, y3);
}
if (y1 > y2)
{
- t = x1; x1 = x2; x2 = t;
- t = y1; y1 = y2; y2 = t;
+ std::swap(x1, x2);
+ std::swap(y1, y2);
}
slope1 = static_cast<gdouble>(y2 - y1);
if (xa > xb)
{
- t = xa; xa = xb; xb = t;
+ std::swap(xa, xb);
}
xa = CLAMP(xa, fx1, fx2);
if (x1 > x2)
{
- gdouble t;
-
- t = x1; x1 = x2; x2 = t;
- t = y1; y1 = y2; y2 = t;
+ std::swap(x1, x2);
+ std::swap(y1, y2);
flip = TRUE;
}
}
else
{
- gdouble t;
-
if (y1 < clip_y || y2 > clip_y + clip_h) return FALSE;
- t = x1; x1 = x2; x2 = t;
- t = y1; y1 = y2; y2 = t;
+ std::swap(x1, x2);
+ std::swap(y1, y2);
flip = !flip;
}
{
if (rx1 > rx2)
{
- gdouble t;
- t = rx1; rx1 = rx2; rx2 = t;
- t = ry1; ry1 = ry2; ry2 = t;
+ std::swap(rx1, rx2);
+ std::swap(ry1, ry2);
}
slope = rx2 - rx1;
{
if (ry1 > ry2)
{
- gdouble t;
- t = rx1; rx1 = rx2; rx2 = t;
- t = ry1; ry1 = ry2; ry2 = t;
+ std::swap(rx1, rx2);
+ std::swap(ry1, ry2);
}
slope = ry2 - ry1;