~ 5% speedup for font-rendering overall
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m55s

This is probably the last speedup for this.
This commit is contained in:
2024-09-11 18:33:29 -04:00
parent 9903fc19c9
commit f6e8875eb9
4 changed files with 12 additions and 40 deletions

View File

@@ -26,51 +26,31 @@ public:
void Grab() {
if (hovered)
{
dragging = true;
}
}
void Release() {
dragging = false;
}
void Update(const Vector2& mouse)
{
void Update(const Vector2& mouse) {
if (dragging)
{
position = position.Lerp(mouse, 0.25f);
}
if (mouse.Distance(position) < range)
{
hovered = true;
} else
{
hovered = false;
}
hovered = mouse.Distance(position) < range;
}
void Draw()
{
void Draw() {
if (dragging)
{
J2D::DrawPoint(Colors::White, position, 4.f);
} else if (hovered)
{
else if (hovered)
J2D::DrawPoint(Colors::Reds::Crimson, position, 6.f);
} else
{
else
J2D::DrawPoint(Colors::Reds::Salmon, position, 3.f);
}
J2D::DrawString(Colors::White, std::format("{:.1f},{:.1f}", position.x, position.y), position.x, position.y, 1.f, 10, FreeSans);
}
protected:
private:
};
Texture* image;
class Camera {
@@ -111,8 +91,6 @@ struct point {
GLfloat t;
};
Gizmo a({250, 150});
Gizmo b({200, 250});
Gizmo c({350, 300});
@@ -191,7 +169,6 @@ public:
J2D::FillCircle(Colors::White, {52, 204}, 50, 24);
J2D::OutlineCircle(Colors::White, {153, 204}, 50, 24);
//J2D::FillTriangle(Colors::Red, {{0, 275}, {0, 375}, {100, 375}});
J2D::FillGradientTriangle(Color4(Colors::Red), Color4(Colors::Green), Color4(Colors::Blue), {{0, 275}, {0, 375}, {100, 375}});
J2D::OutlineTriangle(Colors::Blue, {{100, 275}, {0, 275}, {100, 375}});
J2D::DrawGradientLine(Colors::Red, Colors::Blue, {105, 375}, {200, 275}, 2);