1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:27:34 +00:00

PixelPaint: Allow bigger Brush-Tool sizes

This patch allows a bigger brush tool size of 250 pixels and limits the
cursor bitmap to a reasonable size so that its not much bigger than the
image editor size. If the cursor is bigger as the editor it is rended
with a red edge to indicate that the actual cursor is bigger than
displayed. This change mitigates the OOM conditions when the cursor
gets unusual big.
This commit is contained in:
Torstennator 2023-07-18 14:25:33 +02:00 committed by Sam Atkins
parent 55edfe5c3c
commit 31ee20e179
4 changed files with 46 additions and 22 deletions

View file

@ -2,7 +2,7 @@
* Copyright (c) 2020, Ben Jilks <benjyjilks@gmail.com>
* Copyright (c) 2021, Mustafa Quraish <mustafa@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
* Copyright (c) 2022, Torsten Engelmann <engelTorsten@gmx.de>
* Copyright (c) 2022-2023, Torsten Engelmann <engelTorsten@gmx.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -50,6 +50,8 @@ protected:
virtual void draw_line(Gfx::Bitmap& bitmap, Gfx::Color color, Gfx::IntPoint start, Gfx::IntPoint end);
virtual NonnullRefPtr<Gfx::Bitmap> build_cursor();
void refresh_editor_cursor();
virtual float preferred_cursor_size();
virtual float max_allowed_cursor_size();
float m_scale_last_created_cursor = 0;
private: