mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-26 03:02:27 -05:00
fbfa6543ab
The BrushTool is very cool, but it doesn't allow us to re-use any of the code in other classes. Many of the other tools have duplicated code for handling mouse events / keeping track of previous location, etc. This commit sets up BrushTool so that other tools can inherit from it and override some virtual functions to allow similar behavior without re-writing the code to keep track of mouse positions, etc. In particular, we add public setters/getters for `size` and `hardness` properties, and make `draw_point()` and `draw_line()` virtual so that derived classes can override them. Note: We still pass in `color` as a parameter for `draw_line()` and `draw_point()` instead of using `color_for()` directly because it doesn't really make sense to be constantly asking the ImageEditor for the color when it's not really changing (for instance along all the points of a line) |
||
---|---|---|
.. | ||
3DFileViewer | ||
About | ||
AnalogClock | ||
Assistant | ||
Browser | ||
Calculator | ||
Calendar | ||
CrashReporter | ||
Debugger | ||
DisplaySettings | ||
FileManager | ||
FontEditor | ||
Help | ||
HexEditor | ||
ImageViewer | ||
KeyboardMapper | ||
KeyboardSettings | ||
Magnifier | ||
MailSettings | ||
MouseSettings | ||
PDFViewer | ||
Piano | ||
PixelPaint | ||
Run | ||
Settings | ||
SoundPlayer | ||
SpaceAnalyzer | ||
Spreadsheet | ||
SystemMonitor | ||
Terminal | ||
TextEditor | ||
ThemeEditor | ||
VideoPlayer | ||
Welcome | ||
CMakeLists.txt |