Commit Graph

650 Commits

Author SHA1 Message Date
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 (db4504e816)
- New get event with timeout (e6ec13cc31)
- Convert os::NativeCursor to an enum (06a5b4f3ae)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f)
- Redraw window immediately on "live resizing" (d0b39ebade)
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
David Capello
81d9e8afec Fix bug with Console when the UI Screen Scaling is changed 2020-12-11 15:52:14 -03:00
David Capello
661f4897b2 Check that we're in the UI thread when modifying the widgets collection 2020-10-20 12:54:56 -03:00
David Capello
6862bb8ab0 Fix opening several times the "save changes" alert (fix #2467)
This could happen if we clicked the cross icon in tabs without moving
the mouse.
2020-08-04 15:09:33 -03:00
David Capello
d75c9c443a Use LOG() with the printf-like interface (the only way to be thread safe) 2020-06-17 17:05:43 -03:00
David Capello
f0c9db7041 Don't show the notification flag on Advanced Mode 2020-06-17 12:40:11 -03:00
David Capello
3d2013b33c Draw mask boundaries with a gfx::Path
The path is also cached so on each re-paint we can re-use it while
it's still valid.
2020-05-18 17:58:22 -03:00
David Capello
f491a2a506 Add ui::Entry::Range to simplify code 2020-05-15 18:24:35 -03:00
David Capello
fa187b35a8 Don't delete extra char using Ctrl+backspace to delete words in ui::Entry 2020-05-15 18:15:59 -03:00
David Capello
7cde901047 Alt+backspace deletes a word too on ui::Entry fields 2020-05-12 15:11:15 -03:00
David Capello
263236deb3 Several fixed for Dynamics
* Now the max value in dynamics is equal to the brush size, so changing
  the brush size (e.g. switching between pencil/eraser tools) will
  change the max brush size (which is the most common parameter to
  change)
* Added mini_slider style for min/max brush/angle values
* Fixed some issues clicking outside the dynamics popup
2020-05-02 11:59:34 -03:00
David Capello
cc7bdbcec4 Add a slider style in theme
We've added some code to handle backward compatibility with themes. In
this way we can still load old themes in the latest version but should
look as in previous versions (this will not be done with previous
properties or parts migrated to styles, so we start from now on).
2020-05-01 23:31:10 -03:00
David Capello
b989b46ff2 Log warnings about widget styles only on debug build 2020-04-30 08:45:34 -03:00
David Capello
79f9e28ce8 Added pen pressure sensitivity (fix #710)
- Added support to detect eraser tip on Linux (#610)
- Related to #139
- Still needs works for gradients and better brush interpolations
  between stroke points
- Requested several times, e.g. https://community.aseprite.org/t/1077
  https://community.aseprite.org/t/1881, steam forum, etc.
2020-04-21 22:27:49 -03:00
David Capello
5affdbbae1 Shox extensions in different categories in the Preferences dialog 2020-04-20 14:20:07 -03:00
David Capello
85af3ce735 Fix Widget::previousSibling() impl 2020-04-08 17:48:26 -03:00
David Capello
8b1b624320 Replace NULL to nullptr in ui library 2020-04-08 17:48:06 -03:00
David Capello
9da4b76976 Possibility to scroll menus (fix #2263) 2020-04-03 17:56:35 -03:00
David Capello
09ea577a08 Match ui::MouseButton values to os::Event::MouseButton 2020-03-27 15:40:43 -03:00
David Capello
a0882ba443 Move PACKAGE/VERSION, etc. to new ver-lib
* As we moved the VERSION macro to a .c file, we don't have to
  recompile the whole project when we change the version number.
* Removed the version number from gui.xml
* Removed the invalid first menu item that might appear in the root
  menu when the gui.xml version is outdated in debug mode.
2020-03-16 10:31:32 -03:00
David Capello
95b655168c Use new laf + skia m81 branch
* Some minor refactors due laf changes.
* Updated the instructions to compile Aseprite linking to external
  skia instructions and pre-built packages.
2020-03-01 23:42:08 -03:00
David Capello
d5f0e3189c Fix bug drawing and zooming with the mouse wheel or pinch gesture
The mouse position jumps from one side to other when we zoom because
there were an intermediate scroll change event where the mouse
position is converted using the old zoom.

Fixed regressiong from 951fb7c357
Fixed bug https://community.aseprite.org/t/4587
2020-01-13 15:01:45 -03:00
David Capello
c1d5f8eb0a Move AnimatedWidget from app to ui 2019-12-23 11:14:23 -03:00
David Capello
78353199bb Remove UI_FOREACH_WIDGET_*() macros 2019-12-20 15:24:41 -03:00
David Capello
34ec123ecc Remove MIN/MAX/MID macros from ui library 2019-12-20 15:08:34 -03:00
David Capello
6777c2f34b Add ui::Widget::kCutTopWindowsAndUseChildArea flag 2019-11-15 16:22:44 -03:00
David Capello
5ac07c0823 Fix pressing buttons with Alt+mnemonic or Cmd+mnemonic (regression introduced in 536a4c5d3a) 2019-11-05 10:46:47 -03:00
David Capello
c2acc973ee Add support to show multiple sections in Export Sprite Sheet 2019-10-29 16:37:06 -03:00
David Capello
536a4c5d3a Simplify Export Sprite Sheet with preview + changes to the UI
These changes include an option to split layers and tags
by rows (fix #1118)
2019-10-18 17:00:35 -03:00
David Capello
c25c67733b Include ui/scroll_helper.h in ui/ui.h 2019-10-01 14:35:47 -03:00