Aaron J Yoder
9a07f9cdac
PixelPaint: Speed up and improve memory usage of bucket fill tool
...
This algorithm utilizes a modified scanline method that takes advantage
of the fact that if you are filling rows starting from the top left and
going right, you do not need to check pixels very often except in
certain cases such as at the beginning or end of a row.
There are some tests on top of this that ensure correct filling in all
other cases. This leads to much-improved speed compared to the
4-directional queue method, and no heap allocations.
2022-06-08 21:53:06 +01:00
MacDue
f1baa56cc8
PixelPaint: Add rounded rectangles (both with/without antialiasing)
2022-06-02 13:20:27 +02:00
MacDue
a30c81104d
PixelPaint: Add option for antialiased lines
2022-06-02 13:20:27 +02:00
MacDue
f98dad94fb
PixelPaint: Enable antialiased option for outline ellipsis
2022-06-01 19:33:45 +02:00
MacDue
8ac5f625e9
LibGfx: Rename draw_ellipse/circle to fill_ellipse/circle
...
This makes these functions more consistent with the non-aa painter.
2022-06-01 19:33:45 +02:00
Sam Atkins
cdffe556c8
LibGUI+Userland: Make Dialog::ExecResult an enum class
2022-05-13 16:27:43 +02:00
MacDue
89445b967d
PixelPaint: Add antialiased ellipse option
...
Currently this option is only supported for filled ellipses as that
is all the AntiAliasingPainter supports.
2022-05-07 22:59:02 +02:00
MacDue
60aba4c9f3
LibGfx: Implement AntiAliasingPainter::draw_ellipse()
...
This commit adds draw_ellipse() and moves the shared code
for circles and ellipses to draw_ellipse_part().
draw_ellipse_part() can draw an entire circle in one call using
8-way symmetry and an ellipse in two calls using 4-way symmetry.
2022-05-07 22:59:02 +02:00
Idan Horowitz
086969277e
Everywhere: Run clang-format
2022-04-01 21:24:45 +01:00
Tobias Christiansen
f972f8e7a8
PixelPaint: Use the currently_edited_bitmap in the Tools
...
This way, you can actually edit the mask of a Layer!
2022-03-08 22:07:12 +01:00
Tobias Christiansen
31a9196bfe
PixelPaint: Split bitmap() of Layer into {content, display}_bitmap
...
This is in preparation to support masking of Layers. We now distinguish
between the "display_bitmap" which will be the whole Layer with every
effect applied and the "content_bitmap" which contains the actual
unmodified pixels in the Layer.
2022-03-08 22:07:12 +01:00
Lenny Maiorani
160bda7228
Applications: Use default constructors/destructors
...
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-14 22:06:55 +00:00
Jagger De Leo
d5183cb7ac
PixelPaint: Use Escape to clear rectangular selections
...
Now while dragging a new rectangular selection you can cancel it by
hitting Escape. Existing selections are cleared by Escape as well if the
RectangularSelectTool is active.
2022-02-04 16:11:48 +01:00
Mustafa Quraish
7974fee800
PixelPaint: Inherit from AbstractZoomPanWidget
2022-01-14 01:02:34 +01:00
Elyse
086615535f
Everywhere: Use 'decrease_slider_by()' method from AbstractSlider
...
The same idea as 'increase_slider_by()', it helps us to avoid repeating
the pattern 'set_value(value() - delta)'.
2021-12-30 14:31:50 +01:00
Elyse
d53e1fa1fa
Everywhere: Use 'increase_slider_by()' method from AbstractSlider
...
This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
2021-12-30 14:31:50 +01:00
r00ster91
b6d921f682
PixelPaint: Refactor falloff computation and extend hardness range
2021-12-21 13:52:55 -08:00
Andreas Kling
235f39e449
LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
...
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Musab Kılıç
4de7b3ad24
PixelPaint: Map color_distance_squared from 0 to 1
2021-11-02 12:20:48 +01:00
Marco Cutecchia
81b260bd1c
PixelPaint: Use a bucket cursor for the Bucket tool
2021-10-31 12:37:49 +01:00
Marco Cutecchia
0f24678eaf
PixelPaint: Support using a bitmap as a tool's cursor
2021-10-31 12:37:49 +01:00
Filiph Sandström
d6a0726302
Everywhere: Rename left/right-click to primary/secondary
...
This resolves #10641 .
2021-10-27 22:05:58 +03:00
Gal Horowitz
cd7473d1a3
PixelPaint: Correctly offset stroke position for even thicknesses
2021-10-02 20:54:32 +02:00
Marcus Nilsson
f9e0815c3b
PixelPaint: Move Tools to it's own subdirectory
...
The PixelPaint source directory was getting a bit large, let's move all
the Tools to it's own subdirectory. Also remove some unused includes.
2021-09-20 03:04:24 +00:00