Commit Graph

781 Commits

Author SHA1 Message Date
David Capello
88594bfa0e Merge branch 'main' into beta 2022-09-28 16:20:03 -03:00
David Capello
008df4d03a Add ui::Paint = os::Paint = SkPaint
So now we can have access to Skia SkPaint instance directly from
Aseprite UI code (and set the shader, and other properties that are
not yet well-wrapped in laf-os).

We've simplified ui::CheckeredDrawMode with
ui::set_checkered_paint_mode() function, as now the checkered
background shader is stored in ui::Paint (SkPaint) instead of
ui::Graphics state.
2022-09-28 15:49:30 -03:00
David Capello
9c09a55487 Avoid warning in Release mode in View::updateView() 2022-09-26 19:49:26 -03:00
Martín Capello
a7145ba09c Add asserts to detect when MinSize > MaxSize 2022-09-15 10:06:11 -03:00
David Capello
8b08a88bd1 Merge branch 'main' into beta 2022-08-31 12:31:44 -03:00
David Capello
8d79350b7c Fix minor warning C4468 in MSVC using [[fallthrough]]
This is the warning C4468: 'fallthrough': attribute must be followed by a case label or a default label
2022-08-31 12:28:52 -03:00
David Capello
bc16ab3a71 Fix crash accessing a deleted display using parentDisplay() (fix #3491, fix #2907)
This might be a fix for two frequently reported crashes from Sentry:

1) In Manager::_closeWindow() (#3491): We can reproduce this bug (without
this patch) pressing Ctrl+S to save the active sprite and clicking
randomly in the menu bar (File, Edit, etc. options) to open other menu
boxes (a crash can happen when multiple windows UI is enabled).

2) In set_native_cursor_on_all_displays() (#2907): We weren't able to
reproduce this bug.
2022-08-29 20:01:50 -03:00
David Capello
83857ea600 Merge branch 'main' into beta 2022-08-17 22:58:12 -03:00
David Capello
4e12e427ef Rename "checked" -> "checkered" (background, drawing routines, etc.)
Also rename setBgCheckedSize -> setBgStripeSize in case we add new
background patterns (like horizontal/vertical/diagonal stripes, etc.)
2022-08-17 22:19:07 -03:00
David Capello
05bf34f084 Merge branch 'main' into beta 2022-08-02 16:48:32 -03:00
Gaspar Capello
55885ee266 Fix regression: TextBox isn't rendering text (doesn't update the bounds area of the text box)
Regression in dd0c296209 (Use
tooltip_text style & color to paint tooltip windows #2554).

Prior this fix, text box does not update its bounds area because it
has not a style assigned.

Fix #3442, fix #3443
2022-08-02 16:39:18 -03:00
David Capello
3e6360d024 Fix crash using deleted os::Surface (fix #3451)
It looks like processing a specific kPaintMessage with
ui::Widget::sendMessage() might re-create the os::Surface and destroy
the previous one, so we need to keep a reference to the previous
surface just in case to keep it alive.

We aren't able to reproduce this crash, but we've received several
Sentry reports about it, only on Windows and since v1.2.34.1 (not sure
if it's related to that). We'll see if this does fix the crashes or we
have some kind of regression in the future.
2022-08-02 16:22:13 -03:00
David Capello
5ec88ad659 Merge branch 'main' into beta 2022-07-18 16:05:37 -03:00
David Capello
dd0c296209 Use tooltip_text style & color to paint tooltip windows (fix #2554) 2022-07-18 16:00:13 -03:00
David Capello
1912053f33 Merge branch 'main' into beta 2022-07-15 17:30:39 -03:00
David Capello
c6e3ca0d8b Fix memory leak with IntEntry popups 2022-07-15 12:46:54 -03:00
David Capello
f8f925c634 Merge branch 'main' into beta 2022-07-13 19:49:03 -03:00
David Capello
f14fad77eb Fix std::clamp() assert fail when scrollbars are too small 2022-07-13 16:47:20 -03:00
David Capello
8fe88606c6 Fix possible std::clamp() assert fail 2022-07-07 16:08:40 -03:00
David Capello
1b76076c52 Fix clicking a menuitem that is above another parent menubox/bar (fix #3386) 2022-07-07 16:07:22 -03:00
David Capello
4f2eae6b77 Use C++17 [[fallthrough]] if needed 2022-06-29 20:14:03 -03:00
Martín Capello
c00f4b0d26 Comment m_overlap->setImmutable() to avoid crashing when moving tabs while debugging on windows 2022-06-29 15:02:21 -03:00
David Capello
caf475b2dc Merge branch 'main' into beta 2022-06-15 13:44:34 -03:00
David Capello
b7d5d4a2c9 Editable resize factor in File > Export (fix #3007)
Related to #3008
2022-06-15 12:25:43 -03:00
David Capello
c58dae51fa Fix crash using a deleted surface in Overlay::restoreOverlappedArea()
Can happen when a resize event is received and m_captured stores the
surface with the old window size.

This was found opening a file from the CLI on Linux/X11.
2022-06-14 21:39:38 -03:00
David Capello
8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello
71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -03:00
David Capello
fa6325d237 Add extra checks in Manager::_closeWindow() to avoid crashes
Possible fix for #3362
2022-06-08 13:10:26 -03:00
David Capello
77771b703b Merge branch 'main' into beta 2022-05-30 20:41:35 -03:00
David Capello
251323a4d5 Add new MouseMessage() ctor to copy full information of the original message
This is mainly to keep the pressure information when a MouseMessage is
copied, and any future property which could be added in MouseMessage.
2022-05-30 18:44:12 -03:00
David Capello
684d06ede8 Merge branch 'main' into beta 2022-05-23 18:04:55 -03:00
David Capello
1366a6948c Fix performance issues adding/deleting widgets (related to #3281) 2022-05-20 11:03:12 -03:00
David Capello
52779d4b09 Fix memory leak in UserDataView simplifying its ctor
Each "new gen::UserData" wasn't being freed.
2022-05-19 18:56:21 -03:00
David Capello
9edbd717d8 Swap buffers in Display::flipDisplay() 2022-05-19 17:00:19 -03:00
David Capello
ff5afba6ae Merge branch 'main' into beta 2022-05-19 16:55:30 -03:00
David Capello
922f99ef87 Use Graphics::drawSurface() with explicit Sampling/Paint options 2022-05-17 09:07:24 -03:00
David Capello
0a3644dfbb Update laf module with initial GPU support (#960)
Anyway this is incomplete and Aseprite is not yet ready to support GPU
acceleration (as the rendering phase is CPU intensive).
2022-05-13 11:41:44 -03:00
David Capello
8d2863a58b Merge branch 'main' into beta 2022-05-05 09:57:29 -03:00
David Capello
cc7da16691 Run Console in background so commands can continue running and logging to the console if needed (fix #3227) 2022-04-28 21:58:15 -03:00
David Capello
2a59076f49 Merge branch 'main' into beta 2022-04-25 11:45:31 -03:00
David Capello
65ef6f8e96 Replace utf8 iterators with utf8_decode (fix #3260)
This should fix some problems decoding invalid UTF-8 strings.
2022-04-21 20:24:49 -03:00
David Capello
82a0ec5199 Improve seleting words w/double-clicking on a ui::Entry (fix #3229)
* Now we support selecting multiple words at the same time
* Now punctuation is not included as part of the word
2022-04-19 16:17:28 -03:00
David Capello
83e2604d12 Make ui::Entry smaller 2022-04-19 08:48:50 -03:00
David Capello
52667855d5 Fix public -> private in ui::Timer 2022-04-18 18:01:39 -03:00
David Capello
46626bb5ce Merge branch 'main' into beta 2022-04-13 23:01:12 -03:00
David Capello
721e401052 Fix some memory leaks & simplify code sending UI messages 2022-04-13 21:04:54 -03:00
David Capello
b4d3692927 Add ShowMenu command so the user can customize Alt+top level menu mnemonic shortcuts (#3239) 2022-04-12 22:52:09 -03:00
David Capello
3645afd9a2 Add ui::Widget::resetMin/MaxSize() member functions 2022-04-12 21:14:07 -03:00
David Capello
c450bf7c50 const-correctness for ui::Widget member functions to find children 2022-04-12 21:07:20 -03:00
David Capello
16ca5a55db Merge branch 'main' into beta 2022-04-05 23:16:55 -03:00