Commit Graph

221 Commits

Author SHA1 Message Date
Liebranca ebd17b0ced Show grid cell index in status bar (#2082) 2024-12-09 15:11:06 -03:00
David Capello 5a713448da Noisy MSVC warnings are disabled with laf-base flags now 2024-11-05 11:59:18 -03:00
David Capello 32a099dcb6 Fix crashes with ill-formed fmt format strings (fix #2274)
There is a third-party translation (and can happen with our own
translations) that a fmt format string is ill-formed in the .ini file
of the translation (this could happen even if the en.ini file was
manually modified/broken by hand).

This patch includes a refactor of the Strings class so we can:

1) Static check at compile-time about the number of required arguments
   to format a string (no need to call fmt::format() directly with
   arbitrary number of args)
2) If a string is not valid for the fmt library, the runtime exception
   is caught and the default (English) string is returned.
2024-06-20 20:49:10 -03:00
Guilherme Belchior 531b2ded75 fix #4217: Disable mouse stabilizer while previewing a straight line
This commit addresses the issue where the Shift+brush tool was not disabling the mouse stabilizer, leading to unintended behavior when previewing a line. This commit adds the necessary implementation to properly disable the stabilizer when Shift+brush tool is used. Additionally, the function DrawingState::disableMouseStabilizer() now calls ToolLoopManager::disableMouseStabilizer() to ensure the stabilizer is disabled correctly.
2024-05-23 15:00:39 -03:00
David Capello 34bd6cf336 Show tile flags in the editor canvas when we use Ctrl key/move tool
Added build_tile_flags_string() utility to create the string used in
to show the tile flags (XYD) on the status bar, the editor canvas,
etc.
2023-11-09 16:44:46 -03:00
David Capello 20826e8730 Fix tile information (index/flags) in StandbyState 2023-11-09 16:44:46 -03:00
David Capello 48275d51c2 [lua] Add new AfterAddTile event for tile management plugins
Replaced the App BeforePaintEmptyTilemap event (introduced in
c26351712a) with the new Sprite
AfterAddTile event triggered by draw_image_into_new_tilemap_cel().
This new event handles two cases:

1) When the user paints on an empty tilemap cel, a new tile is
   created, so the tile management plugin can handle AfterAddTile
   to know the existence of this new tile.  (This case was disabled
   with fae3c6566c, then handled with
   c26351712a, now handled with this
   patch).

2) When we copy & paste cels (or drag & drop cels) in the timeline
   between layers, if a new tile is created, the AfterAddTile is
   called and the plugin can associate tiles with its internal
   information (e.g. folders)

Related to: https://github.com/aseprite/Attachment-System/issues/135
2023-07-07 18:40:06 -03:00
Gaspar Capello a628bbb58b Fix changing brush size w/drag value when multiple editors are opened (fix #3884)
This fixes unnecessary propagation of kKeyDownMessage/kKeyUpMessage
messages across all open editors. The pressed key should be sent to
the active editor or the one with the mouse over it.
2023-06-06 10:02:37 -03:00
David Capello c26351712a [lua] Add new 'beforepaintemptytilemap' app event
Now a tileManagementPlugin can customize the creation of empty tiles
when the user starts drawing on an empty cel.

To implement: https://github.com/aseprite/Attachment-System/issues/119
Related to: https://github.com/aseprite/Attachment-System/issues/127
2023-05-18 12:40:12 -03:00
Gaspar Capello fae3c6566c Fix don't create new tiles on tilemap layer in an empty cel with hasTileManagementPlugin. 2023-02-22 12:21:36 -03:00
Joshua Ogunyinka 05c4326ada Add missing language strings for all components using the status bar 2022-10-12 14:23:30 -03:00
David Capello 901175d476 Restore possibility to use Ctrl+Alt to copy selection and snap-to-grid at the same time (fix #3497)
If we don't activate Brush Size mouse wheel action when using Ctrl+Alt
key modifiers in a selection-like tool we can use Ctrl+Alt to make
copies of the selected region and snap-to-grid at the same time.
2022-09-02 11:56:07 -03:00
David Capello 1912053f33 Merge branch 'main' into beta 2022-07-15 17:30:39 -03:00
David Capello f4e83371b8 Several minor improvements to the status bar
* Remove "%3d" for integers (just use "%d"), this is a legacy format
  when the text was a monospace font (it was present from the very
  beginning of the times, when we used the Allegro font)
* New :delta: icon (before :offset: which didn't exist in the theme)
* Show useful info for MovingCelState: mainly cel bounds
2022-07-15 17:03:18 -03:00
David Capello 60a4ebf8f6 Minor change in StatusBar::showColor() to use std::string/fmt::format 2022-07-15 12:30:15 -03:00
David Capello 8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello 4ce2d1a340 Add option to simulate mouse wheel using key shortcut+drag mouse (fix #3195)
Now we can change several values (zoom, brush size, etc.) pressing a
keyboard shortcuts and dragging the mouse in a specific vector
direction (DragVector). It allows the modification of one, two, or
even more parameters at the same time (e.g. X axis to change the brush
size, Y axis the alpha value of the ink).
2022-03-08 20:40:11 -03:00
David Capello 7e76d81fcc Merge branch 'main' into beta 2022-02-18 19:32:33 -03:00
David Capello 2d3de1728c Add SkinTheme::get() to avoid using SkinTheme::instance() as much as possible
This was done to avoid some nullptr references using
SkinTheme::instance() (mainly from
StatusBar::IndicatorsGeneration::add()) when the application is being
closed because an exception was thrown. This might be useful to detect
certain kind of crashes from Sentry.
2022-02-18 19:01:46 -03:00
David Capello ab3bf31c6a Merge branch 'main' into beta 2022-01-06 17:44:43 -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 cb6ccc3dc5 Fix the displayed mouse cursor when the selection is active
Regression introduced in 8c916bf211
2021-06-11 11:46:56 -03:00
David Capello 649f187fc9 Possible fix for a crash transforming tilemaps in certain cases
Crash report: https://igarastudio.zendesk.com/agent/tickets/2300
2021-06-01 10:43:03 -03:00
David Capello bcd69495ce Fix several issues locating windows with multiple UI windows
We've refactored the code to support locating windows (and popups
windows + hot regions) correctly in both modes: with one ui::Display
and with multiple ui::Displays.

For this we've added a new ui::fit_bounds() function that works in
both modes.
2021-03-19 18:57:56 -03:00
David Capello 35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello 8034b0cbcc Add support for multiple native windows (#139, #250, #962, etc.)
Each ui::Window now can have a related native os::Window. This
connection is done through the ui::Display class added recently in
c3d52f0bbe.
2021-03-02 13:50:49 -03:00
David Capello c3d52f0bbe Add ui::Display to support multiple windows in the future
This ui::Display is related to one native os::Window, so the dirty
region/invalid region is now part of a ui::Display instead of a
ui::Manager.

* Replaced ui::display_w/h() functions with ui::Display::size()
  and ui::get_desktop_size()
* The ui::Manager contains the main ui::Display, and in the future an
  ui::Window will have its own ui::Display
2021-02-18 12:34:42 -03:00
David Capello 120fb4dca4 Add support to copy/cut/paste/transform tilemaps 2020-10-02 19:03:53 -03:00
David Capello 44f65ad305 Minor change: use more "auto" before dynamic_cast() 2020-09-25 09:48:56 -03:00
David Capello 8c916bf211 Minor fix to the angle used on each handle for mouse cursors 2020-09-22 17:12:22 -03:00
David Capello 3fbdd40f24 Add skew transformation (fix #71)
This is the first version of the feature, it still needs some
fixes (e.g. avoid skew transform when the pivot is in the same side of
the skew handle which can calculate a division by zero).
2020-09-18 19:29:43 -03:00
David Capello 291ebc6a38 Minor refactor from ui::MouseMessage -> tools::Pointer 2020-08-31 23:17:15 -03:00
David Capello 5ee3ebdd71 Add fg/bg tiles selectors in ColorBar
Now fg/bg colors and fg/bg tiles are different widgets, and the
StatusBar can show tiles when the eyedropper is picking tiles.
2020-08-21 18:28:31 -03:00
David Capello 0bae04f40b Merge branch 'beta' into tilemap-editor 2020-07-21 17:12:09 -03:00
David Capello ce06b55894 Receive a ui::Graphics in TransformHandles::drawHandles()
Instead of using a ScreenGraphics.
2020-07-21 16:43:36 -03:00
David Capello 515dace441 Merge branch 'beta' into tilemap-editor 2020-07-13 17:32:42 -03:00
David Capello 8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
David Capello bd1723313a Merge branch 'master' into tilemap-editor 2020-06-12 11:33:55 -03:00
Gaspar Capello 9c37ea41ed Fix locked layer not completely locked (fix #2181) 2020-06-09 18:03:09 -03:00
David Capello a80af2b304 Merge branch 'master' into tilemap-editor 2020-05-18 20:24:22 -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 46f4002368 Fix crashes saving sprites with '%' char in their filename
To fix this we changed the way StatusBar text is handled (we are using
fmt::format() in StatusBar instead of printf-like ... args now).
2020-05-08 17:39:55 -03:00
David Capello c99a566635 Refactor velocity sensor with tools::VelocitySensor class 2020-04-24 11:19:35 -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 b491e589fd Remove unused variable 2020-04-08 17:29:47 -03:00
David Capello dfaf01ced4 Show tile value in the status bar 2020-02-17 09:06:01 -03:00
David Capello 9073b4aec6 Show correct active tile on status bar when we are in a tilemap 2020-02-17 09:06:01 -03:00
David Capello 9fe05a5dd5 Fix crash double-clicking a moving selection (fix regression in 7b07f29f0b)
Here we avoid two ExpandCelCanvas at the same time with
MovingPixelsState + DrawingState. Double-clicking inside the selection
when we are moving it (MovingPixelsState) could start a new
DrawingState which creates a new ToolLoopImpl that needs a new
ExpandCelCanvas. So we have to drop the pixels before.
2020-02-17 08:28:30 -03:00
David Capello 7b07f29f0b Add possibility to select multiple tiles with double-click + dragging mouse (fix #1988)
Fixes: https://community.aseprite.org/t/1929
Related to #939
2020-02-16 12:42:29 -03:00
David Capello 30b2585037 Save grid bounds inside .aseprite files and doc::Sprite (fix #688) 2019-10-10 15:08:59 -03:00