1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:37:44 +00:00

FontEditor: Correct member type and initialization in UndoGlyph

Makes code_point type u32, consistent with the rest of the system,
and properly initializes it.
This commit is contained in:
thankyouverycool 2021-11-29 11:16:42 -05:00 committed by Andreas Kling
parent e3e3c03dca
commit de77e28360

View file

@ -12,7 +12,7 @@
class UndoGlyph : public RefCounted<UndoGlyph> { class UndoGlyph : public RefCounted<UndoGlyph> {
public: public:
explicit UndoGlyph(const size_t code_point, const Gfx::BitmapFont& font) explicit UndoGlyph(const u32 code_point, const Gfx::BitmapFont& font)
: m_code_point(code_point) : m_code_point(code_point)
, m_font(font) , m_font(font)
{ {
@ -36,14 +36,14 @@ public:
m_restored_width = state.m_width; m_restored_width = state.m_width;
m_restored_code_point = state.m_code_point; m_restored_code_point = state.m_code_point;
} }
void set_code_point(size_t point) { m_code_point = point; } void set_code_point(u32 code_point) { m_code_point = code_point; }
void set_font(Gfx::BitmapFont& font) { m_font = font; } void set_font(Gfx::BitmapFont& font) { m_font = font; }
const Gfx::BitmapFont& font() const { return *m_font; } const Gfx::BitmapFont& font() const { return *m_font; }
u8 restored_width() const { return m_restored_width; } u8 restored_width() const { return m_restored_width; }
u32 restored_code_point() const { return m_restored_code_point; } u32 restored_code_point() const { return m_restored_code_point; }
private: private:
size_t m_code_point; u32 m_code_point { 0 };
RefPtr<Gfx::BitmapFont> m_font; RefPtr<Gfx::BitmapFont> m_font;
u8 m_bits[Gfx::GlyphBitmap::max_width()][Gfx::GlyphBitmap::max_height()] {}; u8 m_bits[Gfx::GlyphBitmap::max_width()][Gfx::GlyphBitmap::max_height()] {};
u8 m_width { 0 }; u8 m_width { 0 };