Commit Graph

3670 Commits

Author SHA1 Message Date
David Capello
792502fc7b Remove invalid ASSERT() from PngFormat::onSave()
The assert can fail if we try to save an indexed image which contain
more than 256 colors.
2015-07-30 18:49:35 -03:00
David Capello
fba9213c9c Fix bug saving invalid .gif files when we use an indexed image with more than 256 colors 2015-07-30 18:46:56 -03:00
David Capello
4a1356cf78 Fix crash when the gif decoder cannot create the sprite 2015-07-30 17:12:53 -03:00
David Capello
32b12d17da Fix visual artifacts on Windows when the window is resized
Now when the user resizes the OS window (a she::Display), it generates
a kDisplayResize she::Event, and this is processed by the UI layer to
redraw the entire ui::Manager.

With this change we remove the obscure "bool" return value in
she::Display::flip() member function.
2015-07-30 16:15:21 -03:00
David Capello
f2d5242ff3 Redraw the entire ui::Manager after resizing
Regression introduced in dd94925cf7
2015-07-30 10:34:39 -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
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
9ca83e2624 Add support to include any kind of widget inside a Menu 2015-07-29 12:32:01 -03:00
David Capello
de3d408581 Unhighlight menu items when the mouse leaves them 2015-07-29 11:42:57 -03:00
David Capello
45b9df78d6 Fix compilation error on clang and gcc 2015-07-28 18:04:31 -03:00
David Capello
1b4ff37112 Simplify remap between old -> new palette
Now the remap is calculated from the old palette to the new palette when
the "Remap" button is pressed. In this way we can remap after loading
a new palette (fix #737), or after generating an optimized palette, or
changing colors (fix #563).
2015-07-28 17:16:32 -03:00
David Capello
056e365cc3 Use a PopupWindow instead of a TipWindow for SnapToGridWindow 2015-07-28 14:55:40 -03:00
David Capello
694b1c8da6 Rename blit_valid_rgn parameter to blitValidRegion 2015-07-28 14:48:19 -03:00
David Capello
a7ea0f7ec5 Add "Snap to Grid" indicator when it's enabled (fix #122) 2015-07-28 13:05:59 -03:00
David Capello
9e5ccbcca9 Remove StatusBar color names in status_bar.cpp 2015-07-28 12:25:15 -03:00
David Capello
0898d685c2 Fix minor UI bug in the initial ContextBar::TransparentColorField state 2015-07-28 11:14:12 -03:00
David Capello
58db0fba09 Fix bug clearing an Image with color=0 in rotsprite
Introduced in commit 35229e99a6
2015-07-28 11:06:35 -03:00
David Capello
8e2feb31bd Implement LockAlphaInkProcessing for indexed images 2015-07-28 10:45:35 -03:00
David Capello
bee6baf812 Select faster ink (INK_COPY) when we use an opaque color and opacity = 255 2015-07-28 10:31:09 -03:00
David Capello
88c4cd8d87 Don't show brush boundaries when the brush & zoom are too small
We can use the CROSS brush preview type instead of BRUSH_BOUNDARIES
2015-07-28 10:21:33 -03:00
David Capello
a1dcb05a99 Add support to copy cels from Indexed <-> Indexed with different palettes 2015-07-27 13:31:19 -03:00
David Capello
bdbffc8e6c Fix bug copying cels from Indexed to RGB sprites 2015-07-27 13:08:25 -03:00
David Capello
8f891a4e25 Add asserts to detect bugs adding cels w/pixel format != sprite's pixel format 2015-07-27 12:40:02 -03:00
David Capello
5a5579973c Add missing palette parameter to render::composite_image()
This is needed when we copy a cel (or cel range) from an Indexed image
to an RGB image.
2015-07-27 12:24:54 -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
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
940dd5f45c Fix alpha compositing on background layer using colors with alpha < 255 2015-07-27 10:53:02 -03:00
David Capello
0f38a7dace Don't use the ColorBar bg color when Background is visible in Flatten 2015-07-27 08:34:05 -03:00
David Capello
64ae80f0d3 Remove some TODO items 2015-07-27 08:21:51 -03:00
David Capello
02d0d7203a Show background layer after Flatten command 2015-07-27 08:20:15 -03:00
David Capello
ea09ada11b Add custom clipboard format on Win32 to copy/paste image+mask+palette 2015-07-26 19:07:51 -03:00
David Capello
c5f898e6a7 Fix compilation error resolving doc::color_t type in gcc and clang 2015-07-23 22:52:49 -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
ba4c34a70f Add options to sort the palette by RGBA channels 2015-07-23 11:13:43 -03:00
David Capello
6aeee0b8fa Show opacity when brush is an image (ignoring the ink type) 2015-07-23 10:43:16 -03:00
David Capello
66ddc62a76 Add an option to share ink/opacity parameters between all tools 2015-07-23 10:07:07 -03:00
David Capello
692a4cf009 Include layer opacity on merge down command 2015-07-23 09:19:08 -03:00
David Capello
ce7c34bb72 Avoid 32-bit integer overflow in median cut algorithm (fix #727)
This fixes a problem generating invalid RGBA entries for an optimized
palette. (E.g. Generating non-opaque pixels when we feed the algorithm
only with opaque pixels.)
2015-07-23 09:05:48 -03:00
David Capello
dd0a6d6a40 Make minor changes in color_histogram.h and median_cut.h 2015-07-23 08:52:37 -03:00
David Capello
5f44ac9d25 Remove unused dithering property in GifOptions 2015-07-23 06:50:08 -03:00
David Capello
b35fc87ec1 Add progress bar when a palette is created from a RGB file 2015-07-22 18:26:25 -03:00
David Capello
96080a378c Remove frameNum from GifEncoder::writeLoopExtension() 2015-07-22 17:41:14 -03:00
David Capello
e71fd36c24 Fix gif_format.cpp compilation on Linux and with giflib 4 2015-07-22 17:30:11 -03:00
David Capello
7f4d4936e1 Re-implement GIF encoder
- Correct usage of disposal methods (and possibility to generate records
  with "restore previous frame" disposal method)
- Create color maps for each frame when necessary
- Remove options to dither RGB images (to simplify encoder)
2015-07-22 16:40:44 -03:00
David Capello
91988de955 Remove unused function create_palette_from_images() 2015-07-22 14:31:59 -03:00
David Capello
8fbf0854b0 Fix layout bug when a file cannot be opened from the recent list in HomeView 2015-07-22 13:14:41 -03:00
David Capello
cee355ee61 Fix minor layout issues in the Preferences dialog 2015-07-18 13:29:23 -03:00
David Capello
65fe7dbccf A GIF color map cannot have more than 256 colors 2015-07-17 12:57:32 -03:00
David Capello
ae2f04f855 Fix creation of local colormaps in GifFormat::onSave() 2015-07-17 12:45:59 -03:00