Commit Graph

679 Commits (master)

Author SHA1 Message Date
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 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
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 dd0c296209 Use tooltip_text style & color to paint tooltip windows (fix #2554) 2022-07-18 16:00:13 -03:00
David Capello c6e3ca0d8b Fix memory leak with IntEntry popups 2022-07-15 12:46:54 -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 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 71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -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 1366a6948c Fix performance issues adding/deleting widgets (related to #3281) 2022-05-20 11:03:12 -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 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 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 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 3ed969ff0a Close all docs correctly even in case of exception (fix #3162) 2022-04-05 23:07:08 -03:00
David Capello 54c354f5d2 Fix forward declaration of os::Sampling 2022-03-10 15:44:56 -03:00
David Capello 5ccf414183 Add options to change the downsampling algorithm (fix #3183)
Also we've restored the default algorithm to bilinear + mipmapping,
which was the default on the Aseprite before we switched to Skia m96.
This was requested by some users.
2022-02-21 15:30:09 -03:00
David Capello 26c1a94b83 Group several mouse movement in one on the Editor
Mainly for Line-like tools (which require the last mouse position
only). Related to #3119, possible fix for several performance issues
on Linux mainly.
2022-01-06 16:54:39 -03:00
David Capello 02de9be1ab Rename src/tests/test.h -> src/tests/app_test.h to avoid confusion with observable tests/test.h 2021-12-23 21:38:17 -03:00
David Capello f93b33f248 Migrate to Skia m96 API 2021-11-17 12:36:11 -03:00
David Capello a0bea17bc0 Avoid continuous redrawing events when moving mouse on Edit > Preferences listbox of sections 2021-11-05 12:41:53 -03:00
David Capello 212e9fbe6c New initial Lua debugger version (#1967)
Incomplete version of the Lua debugger.
Some available features:

* Break in next executed instruction
* Step in, over, out
* See & navigate stacktrace
* See local variables

Some missing features:

* Breakpoints
* Eval user expressions with local variables

The UX needs some improvement yet.
2021-10-12 16:52:14 -03:00
David Capello 9dbbcbd7ef Fix Theme::drawTextBox() to calculate the correct textbox size
If we are only calculating the textbox size (Graphics* g=nullptr) we
don't need to use the View scroll information anyway.
2021-10-12 15:28:57 -03:00
David Capello 7d248c33d7 Fix initialization order of base class and member variable in ui::CloseEvent class
Fixed clang warning: field 'm_canceled' will be initialized after base 'ui::Event'
2021-09-06 18:00:56 -03:00
Martín Capello 05dfd75743 Add cancelation support to CloseEvent 2021-09-06 13:57:57 -03:00
David Capello 1e98a65859 Minor change in ui::Manager::run() 2021-08-18 15:34:05 -03:00
David Capello 5a6bd465f5 Cache mouse cursors to avoid re-generating them on each setCursor()
This should improve the mouse movement, where a new mouse cursor was
created on each mouse movement with black & white pixels. It's a
regression introduced in ef4f691459
(which was originally introduced to improve the mouse movement
perception in a 100Hz monitor).

This might be a possible fix for:
https://github.com/aseprite/aseprite/issues/2713
2021-07-09 10:21:16 -03:00
David Capello 95df0b23d3 Show main os::Window on the first flipDisplay() 2021-07-05 19:42:04 -03:00
David Capello c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816ffccf0ea63a78737ebb6e22cc0453b)
- New get event with timeout (e6ec13cc31e6e689040bc651f98ee1752834d14c)
- Convert os::NativeCursor to an enum (06a5b4f3aebfafb6363ea33d349975d6e419ca7b)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb23f314391e5eaebd7cea84f5179ac7)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f11fda938959c99285fe4f7d7051794)
- Redraw window immediately on "live resizing" (d0b39ebade7736d47e6b2450bf68b088c0da8e57)
2021-07-05 17:51:29 -03:00
David Capello 5f00e6f96a Fix possible crashes on UI menu bar/box logic (fix #2771)
We weren't able to reproduce the crash, but these checks will prevent
the crash itself. (So in the future if we receive a related report, it
will be because something is not working correctly in the menus, but
not a crash report.)
2021-06-15 15:14:17 -03:00
David Capello 37d2b62250 Convert MenuBaseData pointer to std::unique_ptr 2021-06-15 14:35:48 -03:00
David Capello f4ed3ae321 Don't change user-defined pos of Splitter when we resize the window 2021-05-20 20:42:01 -03:00
David Capello ca41785f18 Fix regression: 'Simple Crosshair' mouse cursor dissapears when we switch to Eraser tool
Regression introduced in: ef4f691459
2021-04-16 12:09:49 -03:00
David Capello 6b89075b26 Don't send paint messages when we are closing the app 2021-03-09 16:43:22 -03:00
David Capello 35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello 74ee4dced4 Fix DEBUG_PAINT_EVENTS on Windows 2021-02-25 13:14:39 -03:00
David Capello b1b201a22c Minor change in ui::Widget to check current manager 2021-01-15 13:16:40 -03:00