mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibGfx: Join ScaledFont into Font
Since ScaledFont is the only class inherited from Font we could simply merge them.
This commit is contained in:
parent
16e883a9a3
commit
8e2d1559ec
Notes:
github-actions[bot]
2025-04-21 07:52:41 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 8e2d1559ec
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4409
18 changed files with 166 additions and 234 deletions
|
@ -7,7 +7,7 @@
|
|||
#define AK_DONT_REPLACE_STD
|
||||
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <LibGfx/Font/ScaledFont.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/PathSkia.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibGfx/SkiaUtils.h>
|
||||
|
@ -137,11 +137,11 @@ void PathImplSkia::cubic_bezier_curve_to(FloatPoint c1, FloatPoint c2, FloatPoin
|
|||
|
||||
void PathImplSkia::text(Utf8View string, Font const& font)
|
||||
{
|
||||
SkTextUtils::GetPath(string.as_string().characters_without_null_termination(), string.as_string().length(), SkTextEncoding::kUTF8, last_point().x(), last_point().y(), as<ScaledFont>(font).skia_font(1), m_path.ptr());
|
||||
SkTextUtils::GetPath(string.as_string().characters_without_null_termination(), string.as_string().length(), SkTextEncoding::kUTF8, last_point().x(), last_point().y(), font.skia_font(1), m_path.ptr());
|
||||
}
|
||||
NonnullOwnPtr<PathImpl> PathImplSkia::place_text_along(Utf8View text, Font const& font) const
|
||||
{
|
||||
auto sk_font = as<ScaledFont>(font).skia_font(1);
|
||||
auto sk_font = font.skia_font(1);
|
||||
size_t const text_length = text.length();
|
||||
SkScalar x = 0;
|
||||
SkScalar y = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue