162 Commits

Author SHA1 Message Date
David Capello
4dc6da286e Add zoom slider in StatusBar (issue #420) 2015-08-14 19:46:48 -03:00
David Capello
8e47e507fd Fix Editor::screenToEditor() for sprite positions < (0,0) 2015-08-14 14:26:05 -03:00
David Capello
9966b48139 Add support to drag the selection in other editor when the active one is in MovingPixels state 2015-08-14 13:06:26 -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
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
1b930d4d42 Draw document's extra cel (brush preview) in the current frame only 2015-08-12 17:24:48 -03:00
David Capello
3103f54131 Change zoom scale to avoid similar zoom levels
- Renamed Editor::offset() with padding()
- Changed padding size (and added Editor::calcExtraPadding() function)
- Added Zoom::linearScale() and Zoom::fromLinearScale()
2015-08-04 12:26:58 -03:00
David Capello
43a3ee8bce Fix brush preview flicker 2015-07-31 16:18:53 -03:00
David Capello
bf54fd26d3 Add option to put the onion skin behind the sprite
Fix #526 and fix #412
2015-07-31 15:55:06 -03:00
David Capello
80b47419fd Add an option to onionskin the current layer only (related to #526) 2015-07-31 14:30:11 -03:00
David Capello
dd94925cf7 Move display flip logic to ui library (ui::Manager class) 2015-07-29 18:12:35 -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
694b1c8da6 Rename blit_valid_rgn parameter to blitValidRegion 2015-07-28 14:48:19 -03:00
David Capello
bc29cd4bc5 Set alpha compositing as default
And "replace pixel" and "set alpha" were merged into "copy color" ink.
2015-07-27 11:24:00 -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
c6de475556 Add ContextBar::BrushChange signal 2015-07-06 13:05:06 -03:00
David Capello
e0ad704af1 Remove unused Editor member functions 2015-07-06 11:16:25 -03:00
David Capello
d80b984f00 Adjust default ink to be more pixel-art friendly (just replace RGBA values)
Now that we have alpha channel in color selector and palette entries, it's
nice to have as a default ink a more pixel-art friendly, i.e.
an ink that just replace RGBA values instead of doing alpha compositing.

Issue #286
2015-07-02 13:16:06 -03:00
David Capello
710e640174 Fix preview of transformations (PixelsMovement) 2015-06-25 14:54:06 -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
b12e6c3398 Add ui::MenuSeparator widget 2015-06-24 13:14:41 -03:00
David Capello
f01b816fb5 Remove JI_ prefix from ui/base.h constants 2015-06-23 14:00:00 -03:00
David Capello
401dd5362b Add option to change the "Stop" button behavior (fix #705) 2015-06-19 12:09:34 -03:00
David Capello
b70be3ccd4 Fix performance issues hiding/drawing brush preview w/certain quicktools
This fix a performance problem using the eyedropper (Alt modifier) when
the current tool uses a brush with huge boundaries (e.g. Eraser with
a 64px brush).
2015-06-19 09:45:58 -03:00
David Capello
1af22f1ab7 Remember last frame/layer visited for each document (fix #486) 2015-06-15 11:29:12 -03:00
David Capello
21ca87862c Add layer blending modes (fix #318)
- Added doc::BlendMode enum and doc::BlendFunc type
- Renamed LayerImage::getBlendMode() -> blendMode()
- BLEND_MODE_COPY is BlendMode::SRC now
- BLEND_MODE_NORMAL is BlendMode::NORMAL now
- Added app::cmd::SetLayerBlendMode
2015-06-13 21:29:16 -03:00
David Capello
826aafe2a4 Replace GIMP code to generate mask and brush boundaries 2015-06-11 17:44:27 -03:00
David Capello
4d055a7170 Rename gfx::Rect::createIntersect -> createIntersection 2015-06-09 16:22:47 -03:00
David Capello
f9b76e0f3e Fix crash destroying PixelsMovement's extra cel from Editor::clearBrushPreview()
If Ctrl key isn't mapped to Move tool (or any tool without brush preview),
when we use Ctrl+V to paste clipboard content, the extra cel created
by PixelsMovement will be destroyed by Editor::clearBrushPreview()
when the Editor state changes.

This bug only happened when the brush preview was visible and Ctrl+V was
used. Also it could happen if we mapped any other key (e.g. "A") to
paste the clipboard content directly when we were using a drawing tool
(like the Pencil tool).
2015-06-08 12:13:55 -03:00
David Capello
0a1dfe0633 Merge branch 'onionskin'
Conflicts:
	src/app/ui/editor/play_state.cpp
	src/render/render.cpp
	third_party/gtest
2015-06-05 15:53:15 -03:00
David Capello
1a573fbeb5 Do not recreate the she::Surface on each render 2015-06-02 19:28:49 -03:00
David Capello
71efdfdf76 Add an extra debug check in Editor::play/stop() functions
There are crashes in Editor::stop(). These asserts
were added just to see if we can catch them.
2015-05-28 11:13:15 -03:00
David Capello
a6dd7d8f6d Fix Render's onionskin base/step configuration 2015-05-27 17:47:46 -03:00
David Capello
3388eaffde Show onion skinning depending on the configured loop section (fix #555)
There is a new option (per document) to disable this behavior.
2015-05-27 17:42:41 -03:00
David Capello
625aa1ee55 Move onionskin options into render::OnionskinOptions class 2015-05-27 14:49:01 -03:00
David Capello
f683c50198 Destroy Editor render buffer on exit 2015-05-20 16:23:53 -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
70dd6806a9 Fix problem redrawing eraser cursor when the brush size changes (fix #671) 2015-05-18 15:02:02 -03:00
David Capello
6c882e43d5 Rename Editor::m_cursorThick -> m_cursorOnScreen 2015-05-18 15:00:59 -03:00
David Capello
41ed14f036 Replace ISettings::get/setAutoSelectLayer() with Preferences class 2015-05-13 11:57:13 -03:00
David Capello
06b53981d4 Replace ISettings::get/setRightClickMode() with Preferences class 2015-05-13 11:19:16 -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
bea61fab88 subpixelPos can be in [-1,0] range when we zoom outside sprite bounds 2015-05-07 21:50:15 -03:00
David Capello
804330788b Add right-click popup menu in play buttons to change animation speed (fix #595) 2015-05-07 19:08:24 -03:00
David Capello
ee3d4ca63c Improve zoom movement using a "subpixel" factor
This factor indicates exactly where the mouse is inside the zoomed pixel,
and uses it to locate the new zoom with the same factor (if it's possible).
2015-05-07 17:23:44 -03:00
David Capello
3d29adcbdf Fix zoom behavior when the zoom is changed from the center 2015-05-07 15:13:26 -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
a489efdf03 Use ContextObserver to update the StatusBar
Instead of calling StatusBar::updateUsingEditor(Editor*), now the StatusBar
is a ContextObserver that observe changes in the active doc::Site. The
Editor notifies a ActiveSiteChange event when the active frame/layer
is changed.

Fix #657
2015-05-05 13:24:26 -03:00