128 Commits

Author SHA1 Message Date
Gaspar Capello
95513af267 Fix multiple tileset layers selection move is broken (fix #3144)
Before this fix, a multi-layer mask movement/scaling (with mixed layer
types: normal layer and tilemap layers with different grids) caused
loss of drawing areas.

The heart of this solution is to correctly align the 'selection mask'
and 'transform data' according to the layer's grid, and also, forcing
'site' TilemapMode/TilesetMode before each
reproduceAllTransformationsWithInnerCmds() iteration.
During the life of a PixelMovement object there is a tilemap mode lock.

Additionally arrow keys now work to move a selected area in
TilemapMode::Tiles.
2024-09-03 11:44:25 -03:00
David Capello
e949a5401d Drop selection when we hide a layer that is being transformed (fix #4179, fix #3254)
This fixes several problems in MovingPixelsState where hidden layers
were transformed anyway when we switched the visibility of a layer in
this state.

Other fix was tried before in #3254 but we needed the onBefore/After
layer visibility change notifications to make this work properly
(i.e. drop pixels when the visiblity of a layer is changed).

The only drawback at this moment is that changing the visibility of
the non-active layer when we are transforming multiple cels/timeline
range can be confused because we don't have #2144/#2865 implemented
yet.

This bug was originally reported here: https://community.aseprite.org/t/20621
2024-02-26 17:36:57 -03:00
David Capello
cbe14089af Enable FineControl for selection transformation only if we press the Ctrl key again (fix #3977)
Reimplement #3977 and #3990
2023-11-20 20:02:24 -03:00
David Capello
fee543f9e1 Add option to disable Snap to Grid by default when we move the selection (fix #4153) 2023-11-20 15:19:38 -03:00
Gaspar Capello
3f8a8662fe Fix respect snap to grid when we move the selection (fix #4021) 2023-09-14 13:03:15 -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
1f4e3bcd11 Merge branch 'main' into beta 2022-02-08 12:56:26 -03:00
David Capello
aec012a0d9 Fix crash using a nullptr m_pixelsMovement on MovingPixelsState::onCommitMouseMove() (fix #3161) 2022-02-03 10:57:49 -03:00
Joshua Ogunyinka
aa188d641b Fix moving rectangular marquee box while selecting color (fix #3143) 2022-02-03 10:11:25 -03:00
David Capello
06cfbd794e Use DelayedMouseMove for MovingCelState too (#3119) 2022-01-06 18:43:12 -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
9c5b856aef Fix crash copying floating tilemaps 2021-04-30 10:47:57 -03:00
David Capello
ae904428fa Merge branch 'main' into beta 2021-04-08 16:15:02 -03:00
David Capello
67eeac8045 Fix bug keeping the modified range different than the visible range when moving pixels
When we clicked the current cel/frame/layer on MovingPixelsState in
the Timeline, we weren't dropping the pixels, so the range was
different in the Timeline UI, but we were using the old site range
which was different (bigger) than the Timeline range.

Fixes several bugs: https://community.aseprite.org/t/8618
2021-04-07 18:11:30 -03:00
David Capello
35bb3af6e2 Replace all base::Bind() with lambda functions 2021-03-05 20:09:42 -03:00
David Capello
edebb57f66 Refactor clipboard code
* Moved all clipboard:: functions inside app::Clipboard class
* Convert app:📋:ClipboardFormat enum to
  app::ClipboardFormat enum class
* Added app::Context::clipboard()
2020-09-25 11:14:52 -03:00
David Capello
44f65ad305 Minor change: use more "auto" before dynamic_cast() 2020-09-25 09:48:56 -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
3623720dd4 Merge branch 'master' into beta 2020-08-18 11:05:37 -03:00
David Capello
95ce7541e7 Avoid redrawing transformation on each mouse position change (related to #2149) 2020-08-17 17:35:34 -03:00
David Capello
4e08d12f28 Merge branch 'master' into beta 2020-08-06 10:46:32 -03:00
David Capello
819517b941 Fix reported crash in MovingPixelsState::onUpdateStatusBar()
This should be enough to fix a crash reported where we receive a
onUpdateStatusBar() when m_pixelsMovement is already deleted. It's
called from onLeaveState() when we call notifyGeneralUpdate() which
generates a scroll change and finally updates the status bar.

Crash report: https://igarastudio.zendesk.com/agent/tickets/1239
2020-08-04 11:12:57 -03:00
David Capello
8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
Gaspar Capello
9c37ea41ed Fix locked layer not completely locked (fix #2181) 2020-06-09 18:03:09 -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
602d844085 Restore DropPixelsField on ContextBar when switch to a editor in MovingPixelsState 2019-09-11 16:08:58 -03:00
David Capello
0b44b83cf3 Add a timer to MovingPixelsState to avoid RotSprite on each mouse move
We can use the fast algorithm for fast feedback, and use a timer to
draw with RotSprite when the mouse doesn't move after 50ms.
2019-09-05 20:03:16 -03:00
David Capello
3e478d3efa Transform/scale/rotate multiple cels at the same time (fix #1148, #1172, #1238, #1364)
Requested in twitter, the forum, and in several other places and
frequently over all these years:
https://community.aseprite.org/t/scaling-multiple-frames-simultaneously/240
2019-09-05 15:03:13 -03:00
David Capello
2d979c521c Update status bar info immediately after rotating/transforming the selection 2019-09-03 16:37:12 -03:00
David Capello
d32fd97da5 Replace base::SharedPtr with std::shared_ptr
We can remove our smart pointer (base::SharedPtr) as we're already
using C++11 compilers on all platforms.
2019-08-01 19:16:16 -03:00
David Capello
79795b97a9 Fix hang if we press Cmd-S two or more times quickly to launch File > Save
With this we avoid to unintentional execute two or more times a
command when we are already in a command execution.
2019-06-03 23:02:24 -03:00
David Capello
59361a3b6d Minor changes about how aspect ratio is presented on the status bar 2019-04-10 13:51:15 -03:00
David Capello
89bf12a60a Fix arrow keys to move the selection content
Regression introduced in 1c05ea10bb7c6cde8bfc04711ebf104f5b7da658
2019-02-15 17:33:48 -03:00
Gaspar Capello
1c05ea10bb Fix shift after flip throws error (fix #1873) 2019-02-15 11:18:14 -03:00
Gaspar Capello
3dc76d08c4 Add aspect ratio on status bar (fix #1769) 2019-01-10 07:14:01 -03:00
David Capello
f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello
b3c89cd110 Rename DocumentView -> DocView 2018-07-14 23:24:49 -03:00
David Capello
8d3da46ac9 Rename DocumentReader/Writer -> DocReader/Writer 2018-07-14 22:49:22 -03:00
David Capello
a360c4fcc4 Merge branch 'master' 2018-07-07 12:20:25 -03:00
David Capello
9c79ea2b77 Rename app::Document -> Doc 2018-07-07 11:54:44 -03:00
Gaspar Capello
a69a120e14 Flip command changes to moving pixels state (fix #1738) 2018-07-06 16:22:44 -03:00
Gaspar Capello
a7c7e82aa8 Fix clickable pivot pos in StandbyState (fix #1608)
Also reported in https://community.aseprite.org/t/pivot-point-doesnt-recalibrate-when-setting-its-direction/1228
2018-05-03 11:39:01 -03:00
David Capello
072e223ec5 Fix eyedropper to use the real mouse position received in messages
Instead of the global mouse position, we can use the more proper
mouse position receive in editor messages.
2018-03-16 12:26:38 -03:00
David Capello
e0a60b6748 Generate the list of command IDs from en.ini file 2017-12-01 15:10:21 -03:00
David Capello
eb3143ce21 Rename CommandsModule to Commands 2017-11-30 12:24:07 -03:00
David Capello
2d51b8dfff Disable selection handles when a key modifier is pressed
From: https://twitter.com/ChevyRay/status/893563998410387457
2017-09-08 12:07:21 -03:00
David Capello
54e8a59cbd Fix crash changing opaque/transparent color on MovingPixelsState state
The MovingPixelsState() ctor was generating a
MovingPixelsState::onTransparentColorChange() for the previous state
with a m_pixelsMovement==nullptr.
2017-05-26 12:00:15 -03:00
David Capello
90c364fe30 Add possibility to drag & drop the selection 2017-04-06 15:26:01 -03:00