Commit Graph

88 Commits

Author SHA1 Message Date
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
David Capello 7c6d927eb1 Zoom tool now can be used in PlayState 2017-01-06 17:44:08 -03:00
David Capello efce7d56a8 Keep selection after clear moving pixels (fix #1334)
If Aseprite is configured to keep the selection actived after clearing
the selection, we must keep the selection active anyway if we've moved
it.
2016-12-02 17:36:35 -03:00
David Capello cc18334c5a Changes in LOG/TRACE messages 2016-10-27 12:25:33 -03:00
David Capello 6377b550e3 Replace base::Signal/Observable* with obs::signal/observable
We can use the obs library directly for signal/slots and observable
objects.
2016-09-13 15:02:00 -03:00
David Capello 638206becd Don't destroy linked cels after moving the whole cel content (fix #1214) 2016-09-12 16:44:14 -03:00
David Capello 76fefe64f2 Fix several issues dropping pixels in MovingPixelState (fix #1241) 2016-09-07 10:40:32 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello 9c73841970 Move gfx::Transformation to app::Transformation
In this way gfx library doesn't depend on fixmath.
2016-07-11 15:40:27 -03:00
David Capello ee1dac0893 Right-click subtract selection again on floating pixels (fix #1164) 2016-07-01 10:07:55 -03:00
David Capello 34b8be3114 Fix status bar values when we move pixels 2016-05-27 13:22:25 -03:00
David Capello 4929efbd9c Remove "Moving Pixels" label in status bar 2016-05-18 11:55:39 -03:00
David Capello a09b00dba8 Fix synchronization of different UI elements depending on the active tool
With this patch now the context bar shows the real active tool
preferences. For example, if we choose the option to use the Eraser
tool with right-click, now right-clicking will draw with the Eraser
brush size (instead of using the selected tool/left-click tool brush
size).

Changes:
* Removed the toolBox.activeTool() field from preferences
  (as the option isn't persisted between sessions)
* Added an observable app::tools::ActiveToolManager class to sync all
  UI elements that depend on the active tool and ink.
* Moved a lot of "active tool" logic from app::Editor to the
  new ActiveToolManager
* Moved app::tools::ToolLoopManager::Pointer as an indepedent
  app::tools::Pointer class
2016-04-25 15:20:53 -03:00
David Capello 5f90ef7c9b Add properties in App to access directly to timeline/contextBar/workspace 2016-04-22 13:19:06 -03:00
David Capello 87ef48b50b Improve status bar with icons/automatically generated and re-used parts (fix #752) 2016-04-19 13:45:23 -03:00
David Capello 8a5de088e2 Add scaling from center/pivot (fix #576) and with flipping (fix #579) 2016-04-08 11:55:40 -03:00
David Capello b0650f6afe Generalize View::setViewScroll() to blit valid/scrollable region automatically
With this change we are removing specific code to scroll the Editor widget.
Now if we use Editor::setEditorScroll() to scroll it should work as
View::setViewScroll(). In this way we remove the ugly "blitValidRegion"
parameter from setEditorScroll().

Changes:
* Removed Widget::scrollRegion() because each widget must control
  valid/invalid regions after a ui::move_region() in a very specific way
  (see View::setViewScroll() or Window::moveWindow)
* Invalidate the whole widget on Widget::setBoundsQuietly()
* Fixed problems blitting invalid regions/not yet updated/painted: using
  the new ui::Manager::m_invalidRegion.
* Added View::onSetViewScroll() and View::onScrollRegion()
* Added FileListView to avoid moving the thumbnail region when we scroll
2016-01-05 16:37:52 -03:00
David Capello e944ce0052 Move Bind, Connection, Signal, Slot, etc. to base namespace 2015-12-04 15:17:42 -03:00
David Capello 1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
David Capello 74e642d997 Add extra KeyContexts for each selection transformation 2015-09-11 20:04:02 -03:00
David Capello d6684691bf Rename PRINTF to LOG 2015-08-28 20:48:49 -03:00
David Capello 0645a66521 Fix pressing multiple KeyAction modifiers at the same time (fix #778) 2015-08-25 13:29:19 -03:00
David Capello 462f1f395e Add support to rotate the selection/moving pixels (fix #161) 2015-08-13 21:47:30 -03:00
David Capello 40394d9695 Enable commands when we're in MovingPixelsState
Now ContextFlags enable some flags if it detects that the current editor
is in MovingPixelsState. In this way commands "think" that they are able
to lock the document for write access (finally they will be able, because
MovingPixelsState::onBeforeCommandExecution() unlocks the document
just before the command is executed).

Fix #275, fix #690, fix #750
2015-08-13 17:25:39 -03:00
David Capello 2eb757995d Catch exception if we cannot change the selection transparent color
We have a memory crash dump where wasn't possible to change the
selection transparent color because the data recovery thread was creating
the sprite backup.
2015-08-12 15:26:49 -03:00
David Capello 46fa7e18cf Remove MovingPixelsState as an Editor observer when the editor is destroyed 2015-07-29 16:48:34 -03:00
David Capello 7cfdf76b0e Add rotation pivot options in context bar (fix #370)
With these options we can configure to show the pivot and the default
location when we select a sprite area.
2015-07-29 16:35:34 -03:00
David Capello 41bb23f1f1 Change opaque/transparent selection by default depending on the layer 2015-07-27 11:43:48 -03:00
David Capello 35229e99a6 Add opaque/transparent mode in context bar for transformations (fix #546)
With this change now we add a "mask" image/parameter in rotation
functions. In this way we can identify which specific pixels are
inside the original mask/selection, and in opaque mode we can
include/scale/rotate all those pixels inside the mask, whatever
value they are, even if they are the mask color.

Fixes #730
2015-07-23 22:42:14 -03:00
David Capello f571e4ceb2 Add BrushPreview class to wrap all code related to brush preview/editor cursor 2015-06-25 12:44:47 -03:00
David Capello 3c60136631 Move PI constant to base/pi.h file 2015-06-16 15:04:00 -03:00
David Capello 61c745ee7c Patch a possible crash when dropping pixels onBeforeFrameChanged
This is not a "real fix". But we hope the program at least doesn't crash
in this scenario.

Reviewed this problem on #275, #424, and #690
2015-06-02 16:46:04 -03:00
David Capello ecb4c8b464 Convert MovingPixelsState connections to ScopedConnections 2015-06-02 11:15:33 -03:00
David Capello f6be0c3be6 Replace ISettings with Preferences
Changes:
* Move FreehandAlgorithm/InkType/RotationAlgorithm/SelectionMode to
  app::tools namespace
* Removed ISettings, IToolSettings, IBrushSettings, ISelectionSettings,
  and IColorSwatchesStore (and implementations from UISettingsImpl)
* Added app::tools::PreferenceGlue to do some adjustments that
  UIToolSettingsImpl was doing
* Remove signals from App related to brush size/angle changes, and current
  tool change (there events can be observed directly from Preferences)
* Remove ColorBar::FgColor/BgColor, these options can be observed from
  Preferences::colorBar.fg/bgColor
2015-05-18 16:53:25 -03:00
David Capello cd1f764d85 Rename EditorState::onBefore/AfterChangeState to onLeave/EnterState()
This is to avoid confusion about the meaning of these callbacks.
2015-05-10 19:32:42 -03:00
David Capello 18b067ee77 Add ContextBar::updateForCurrentTool() which is a common thing to do 2015-05-07 12:32:08 -03:00
David Capello a49a36d7e1 Change Command::short_name() to id() (and from const char* to std::string) 2015-05-01 19:41:18 -03:00
David Capello 22c3c4f20e Remove implicit SharedPtr conversion to T* 2015-04-02 20:42:43 -03:00
David Capello 0cb4b2234d Always load params when a command is executed
This is to avoid leaving commands with old params (a problem with
keyboard shortcuts). To make sure, we've changed arguments from Params*
to Params&, so we always have params to load.

Also, in this change we introduce a new way to give parameters to executed
commands from menu items using AppMenuItem::setContextParams(). Before
showing a popup, we can call setContextParams() to give extra params to
the command (e.g. the specific FrameTag to remove or change properties).
In this way "contextparams" attribute for <item> in gui.xml is not
available anymore.
2015-03-11 15:40:22 -03:00
David Capello 361a3084fd Merge branch 'new-workspace'
Conflicts:
	src/app/commands/cmd_open_file.cpp

Fixes:
	src/app/ui/timeline.cpp
2015-03-04 22:41:34 -03:00
David Capello ad856b2a55 Use std:: when necessary, and std::numeric_limits instead of INT_MAX 2015-03-04 21:35:11 -03:00