mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-20 13:04:21 -04:00
Changes draw command implementation to properly follow
command design pattern. All drawing commands have been
moved to separate inheriting draw commands from renderer.
Other changes:
- New draw methods overloads have been added to pixel renderer.
Now pixel rendering methods are in one class.
- Simplified draw commands naming.
- Changed variable naming in draw commands to be more verbose.
- Changed {x,y} pairs to Points where possible.
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include "Color.hpp"
|
|
#include "Common.hpp"
|
|
|
|
#include "DrawCommand.hpp"
|
|
|
|
#include <module-utils/math/Math.hpp>
|
|
|
|
namespace gui
|
|
{
|
|
class Context;
|
|
} // namespace gui
|
|
|
|
namespace gui::renderer
|
|
{
|
|
class ArcRenderer
|
|
{
|
|
public:
|
|
struct DrawableStyle
|
|
{
|
|
Length penWidth{1};
|
|
Color color{ColorFullBlack};
|
|
|
|
static auto from(const DrawArc &command) -> DrawableStyle;
|
|
};
|
|
|
|
static void draw(Context *ctx,
|
|
Point center,
|
|
Length radius,
|
|
trigonometry::Degrees begin,
|
|
trigonometry::Degrees sweep,
|
|
const DrawableStyle &style);
|
|
|
|
private:
|
|
static void draw(Context *ctx,
|
|
Point center,
|
|
Length radius,
|
|
trigonometry::Degrees begin,
|
|
trigonometry::Degrees sweep,
|
|
Color color);
|
|
|
|
static void draw(Context *ctx,
|
|
Point center,
|
|
Length radius,
|
|
trigonometry::Degrees begin,
|
|
trigonometry::Degrees sweep,
|
|
Color color,
|
|
Length width);
|
|
};
|
|
} // namespace gui::renderer
|