Commit Graph

91 Commits

Author SHA1 Message Date
David Capello 6ce73a831a Don't allow draw/modify reference layers 2016-10-17 13:49:28 -03:00
David Capello e46d453356 Merge branch 'master' into beta 2016-09-23 13:21:51 -03:00
David Capello b75d87c5fc Fix glitches with 'on sprite crosshair' after modifying sprite areas 2016-09-23 10:28:15 -03:00
David Capello d4c4cb5f72 Fix graphical glitches while painting (fix #1262) 2016-09-22 20:16:14 -03:00
David Capello 20b726f73b Merge branch 'master' into beta 2016-08-31 19:53:52 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello ac20d1edfc Fix some commands/editor states to check parent group editable/visible state too 2016-06-15 15:27:38 -03:00
David Capello 37209a0f5b Add pixel ratio support to the Editor & Render 2016-05-23 19:22:02 -03:00
David Capello b2b2edb4bc Remove unused field ToolLoop::zoom() 2016-05-23 17:29:44 -03:00
David Capello 975c1bd0a5 Remove reference to the old raster::Dirty object 2016-05-05 15:25:19 -03:00
David Capello 0f3dea233b Fix problems using paint bucket referring to all layers and cels origin != 0,0
With this change we've simplified several portions of the ToolLoop code
where the "cel origin" is added and then subtracted needlessly.
2016-05-04 00:02:56 -03:00
David Capello 6dc9bb984d New option for paint bucket using all layers as reference/stop fill (fix #969) 2016-05-03 15:31:27 -03:00
David Capello 640025e84b Fix selection UX to show white/black negative for the stroke
With this patch now we can use the selection tool in locked or hidden
layers, because the selection doesn't modify the layers (only the
selection). Also we can use the selection tool on any layer and we'll
always see the feedback stroke/shape/rectangle while we're creating
the new selection.
2016-05-02 18:42:02 -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 c5f7e9618b Use the real current tool preferences to draw and in the brush preview
The "real" current tool is the one in the editor returned by
getCurrentEditorTool() (which depends on quicktool modifiers
and right-click configuration).
2016-04-21 01:20:59 -03:00
David Capello 2ce09c53dd Add customization for square aspect, draw from center, and move origin keys (fix #1028)
Some changes:
- Now ui::Keys aren't processed in app::tools side, they are processed
  in Editor side and converted to ToolLoopModifiers flags.
- Replace ToolLoop::getSelectionMode -> ToolLoop::getModifiers()
2016-04-04 18:46:48 -03:00
David Capello 2af47fe907 Add option to toggle the selection edges visibility (fix #861) 2016-03-24 13:04:35 -03:00
David Capello cf7c4754cc Convert InkShadesField in a combobox-like widget to store several shades (#85)
Changes:
* Added new ui::IconButton widget to create widgets with one skin icon
  that is colored depending on the button state.
* ContextBar::InkShadesField was divided into a couple widgets (ShadeWidget
  and IconButton to drop-down a little menu with saved shades)
* Fixed CommonLockedSurface::drawColoredRgbaSurface() impl.
* Removed invalid gfx::setr/g/b/a() functions.
2015-11-24 18:37:13 -03:00
David Capello 78daffba73 Fix shading mode on RGB mode when index 0 is involved (fix #794)
As now the RgbMap is generated correctly depending on the current layer
(if it’s opaque or transparent), we’ve fixed
LockAlpha/Transparent/Merge/Blur/Replace/JumbleInkProcessing for
Indexed images with a background layer, when a transparent layer is the
active one, and when a non-mask index has same RGB values than the mask
index.
2015-11-04 10:33:23 -03:00
David Capello 08a04fcb64 Fix symmetry mode when cel origin != sprite origin (0,0)
Change ToolLoop::getOffset() to getCelOrigin()
2015-11-02 16:44:17 -03:00
David Capello a3deb2063e Add MovingSymmetryState to modify symmetry axis position 2015-10-28 20:00:18 -03:00
David Capello 56854cdb9f Add symmetry mode (fix #208)
This is a first iteration of the feature, it doesn’t have handles to
move the symmetry line and it only contains two symmetry modes:
horizontal or vertical.

As an extra change, we have added the new Stroke type to wrap a vector
of gfx::Points and simplify some existing code in the ToolLoop.
2015-10-26 17:51:32 -03:00
David Capello 3d4fdb62b4 Pass opacity value to Eraser, Blur, and Jumble tools 2015-09-30 08:59:32 -03:00
David Capello 8aefa24a5b Add key modifier to draw straight lines from the last point (fix #562)
- Removed ToolLoop::screenToSprite(), now ToolLoopManager::Pointer has
  sprite coordinates (instead of screen coordinates)
2015-09-16 12:19:10 -03:00
David Capello f3ac563e33 Add shading ink (fix #85) 2015-08-26 16:48:01 -03:00
David Capello 22adb9d7d3 Do not share Ink instances between different tools::ToolLoop implementations (fix #764) 2015-08-19 12:58:56 -03:00
David Capello b6744cc1f7 Remove context parameter from create_tool_loop_preview() 2015-08-19 12:54:57 -03:00
David Capello 82243a0763 Add an assert in ToolLoopImpl to check that the editor document is equal to the context's active document 2015-08-18 19:29:37 -03:00
David Capello 2341d4e747 Remove unnecessary return statement 2015-08-18 19:28:49 -03:00
David Capello 782aa72faf Fix opacity value for custom brushes 2015-08-13 15:41:37 -03:00
David Capello 32bf3314e6 Add a new simple/default ink
This ink behaves as alpha compositing but doesn't use the opacity slider
(opacity is used from current color's alpha channel). Also, in case that
we pick the mask color, it behaves as the eraser tool.
2015-08-13 13:26:52 -03:00
David Capello b75b9a6f1b Don't redraw brush preview area in other editors if they aren't in the current frame 2015-08-12 17:32:17 -03:00
David Capello 940dd5f45c Fix alpha compositing on background layer using colors with alpha < 255 2015-07-27 10:53:02 -03:00
David Capello 204e2a28b7 Fix problem with brush preview after using a drawing tool 2015-07-06 11:05:49 -03:00
David Capello 49b3502318 Keep fg/bg color indexes in the palette range 2015-06-29 11:00:46 -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 90f988d928 Add option to ignore grid limits in paint bucket or magic wand tools (fix 564) 2015-06-17 13:22:46 -03:00
David Capello 2ff0f1e2a4 Remove app::tools::PreferencesGlue
Now we check the trace policy and intertwine in the same ToolLoopBase
class just before start drawing.
2015-05-21 16:14:26 -03:00
David Capello 49954ddd29 Create ToolLoopBase with common code between ToolLoopImpl and PreviewToolLoopImpl 2015-05-21 16:00:27 -03:00
David Capello 9a1c522084 Remove unused variables 2015-05-19 13:44:00 -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 b08b226aef Move active brush information to ContextBar 2015-04-28 18:21:33 -03:00
David Capello f09db4d9aa Add new BrushPopup (now the image brush is previewed)
This is the first step to create a bigger BrushPopup to select brushes
from an history of brushes. The general idea is to use Alt+1, Alt+2, etc.
to select different brushes from a stock.

Also the "discard brush" was removed. As the brush can be discarded
changing the brush type.
2015-04-28 12:38:15 -03:00
David Capello d9fb81e5d1 Now we can create brushes selecting the box directly (fix #154) 2015-04-27 11:31:48 -03:00
David Capello dfeff22b2f Add possibility to create brushes from selection
Changes:
* Add doc::kImageBrushType
* Add doc::BrushPattern enum
* Add pattern and pattern origin properties to doc::Brush
* Add NewBrush and DiscardBrush commands (new Ctrl+B shortcut to create
  brushes)
* Add BrushInkProcessing
2015-04-27 00:08:04 -03:00
David Capello 4e6db14cae Use a PreviewToolLoopImpl to preview the current tool ink/point shape/etc
With this we can see the exact preview in real-time of the the left
click paiting (e.g. using real Indexed composition, ink, point shape, etc.)
We are able to preview blur, eraser, or flood fill preview too (anyway
these are not enabled at this moment).
Changes:
* Add render::ExtraType enum to indicate if the extra cel acts like a
  patch for the current cel (e.g. cursor), or as an extra layer for
  composition (e.g. selection/moving pixels)
* Add ExtraCelType property to app::Document and to render::Render
* Add ToolBox::getPointShapeById()
* As the current cursor preview depends on the current layer, when
  we change the current layer we've to update the Preview editor
  with the new selected layer (now we listen to
  Document:.onAfterLayerChanged())
* Add create_tool_loop_preview() and PreviewToolLoopImpl
2015-04-26 15:59:28 -03:00
David Capello 21c4fd51d9 Move app::DocumentLocation to doc::Site
This is a first step to include the current selected range of layers
and frames inside the doc::Site structure. So in the future we'll not need
to know about the Timeline in commands that handle those ranges.
2015-04-20 16:27:09 -03:00
David Capello 61edf07fdc Fix problem showing exception in ~ToolLoopImpl()
We cannot have DrawingState::m_toolLoopManager = nullptr when we call
Console::showException() (as the Editor will continue sending some mouse
messages to the DrawingState).
2015-04-10 11:12:19 -03:00
David Capello 1bed018ab0 Add timeout parameter to Context/Document lock/unlock operations 2015-04-10 11:10:42 -03:00
David Capello 32bb9c85dc Avoid infinite locking ~ToolLoopImpl()
This situation happens when we have two views for the
same document, and we move the selection in one view,
and then we try to continue the transformation in the
other view.
2015-04-09 20:05:02 -03:00