LibGfx+LibWeb: Store Typeface and Font-related types in RefPtr to const

This commit is contained in:
Andrew Kaster 2025-04-15 15:48:14 -06:00 committed by Andrew Kaster
commit be2dd91289
Notes: github-actions[bot] 2025-04-16 16:44:15 +00:00
13 changed files with 28 additions and 28 deletions

View file

@ -16,7 +16,7 @@
namespace Gfx {
ScaledFont::ScaledFont(NonnullRefPtr<Typeface> typeface, float point_width, float point_height, unsigned dpi_x, unsigned dpi_y)
ScaledFont::ScaledFont(NonnullRefPtr<Typeface const> typeface, float point_width, float point_height, unsigned dpi_x, unsigned dpi_y)
: m_typeface(move(typeface))
, m_point_width(point_width)
, m_point_height(point_height)

View file

@ -17,7 +17,7 @@ namespace Gfx {
class ScaledFont final : public Gfx::Font {
public:
ScaledFont(NonnullRefPtr<Typeface>, float point_width, float point_height, unsigned dpi_x = DEFAULT_DPI, unsigned dpi_y = DEFAULT_DPI);
ScaledFont(NonnullRefPtr<Typeface const>, float point_width, float point_height, unsigned dpi_x = DEFAULT_DPI, unsigned dpi_y = DEFAULT_DPI);
ScaledFontMetrics metrics() const;
// ^Gfx::Font
@ -45,7 +45,7 @@ public:
SkFont skia_font(float scale) const;
private:
NonnullRefPtr<Typeface> m_typeface;
NonnullRefPtr<Typeface const> m_typeface;
float m_x_scale { 0.0f };
float m_y_scale { 0.0f };
float m_point_width { 0.0f };