1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 17:49:47 +00:00
Commit graph

1404 commits

Author SHA1 Message Date
Manolis Papadeas 38711d2ccf Fix HTML5 shader issue
The MarchingAntsOutline was failing to compile on the Web platform due to the for loop not having constant expressions inside the shader. "Loop index cannot be initialized with non-constant expression"
2021-04-17 22:33:13 +03:00
Manolis Papadeas 27cb0d2d2f
New selection system (#474)
* Basic move tool

* Added marching ants effect on the selection borders

* Rename SelectionRectangle to SelectionShape, make it have non-rectangular shape and multiple SelectionShapes can exist

- Create multiple selection rectangles
- Merge them together if they intersect
- Move the selections (without contents as of right now)
- Gizmos are being drawn but they are not functional yet

Code is very ugly.

* Sort vectors counter-clockwise to be used as polygon borders

I did this, no idea if it works properly, probably won't be used but I thought I'd keep it saved somewhere

* More experiments I may or may not need

Trying to generate a polygon from the individual selected pixels

* Change default rectangle select behavior and ability to clip polygons using Control

* Fix rectangle selection clipping

* Split polygon into two with selection subtracting

* Move selection with contents with the move tool

Code is still a mess, don't bother looking.

* Move some methods from SelectionShape.gd to Selection.gd

The purpose of this is to generalize some selection code, so that it applies to all polygons, the entire selection. More will follow.

* UndoRedo for border moving

Nothing else in the selections system works properly in UndoRedo right now. Needs:

- UR support for creating selections
- UR support for modifying selections (merging and cutting selections together)
- UR support for removing selection
- UR support for moving content

& for all the rest of the remaining features

* Moving all of the selection shape logic to Selection.gd

Handle all of the polygons there instead of having them as individual nodes. Should be easier to handle undo/redo this way. This commit probably breaks move tool + selection tool and undo/redo. Code is still a mess. For your sanity, I hope you are not reading this. I promise I will clean up.

* Move tool works again

Buggy and messy, of course.

* Remove unneeded code and restore selection move undoredo logic

* Made Selection.gd have one big preview_image for when moving content, instead of each polygon having its own image

Could be further optimized for some specific cases. We could also remove selected_pixels from SelectionPolygon.

* UndoRedo support for creating, deleting, merging and clipping selections

UndoRedo support for moving content not added in this commit. Should work but needs more testing. This PR also removes selected_pixels from the SelectionPolygon class.

* Confirm & cancel selection movement, should support undoredo properly too

Press Enter or do any editing to confirm movement, Escape to cancel. I will most likely add UI buttons for confirm and cancel too.

* Mirror View affects selection

* Restore Cut, Copy, Paste and Clear Selection

Pasting now no longer requires a pre-existing selection and instead copies the selections themselves too.

* Created a new Select menu, which has Select All and Clear Selection as options

Clear Selection now also confirms content moving. TopMenuContainer code has changed to no longer rely on Global for the menu buttons.

* Draw gizmos as rectangles

No functionality yet. They may need to be turned to nodes, so that they can easily resize based on zoom level and check for mouse enter/exit events.

* Made gizmos get drawn in the sides and corners of the big bounding rectangle instead of individual selection parts

Still no functionality yet.

* Restore label text

* Minor optimization when clipping selections

This will execute the for loop less times

* Made a Gizmo class, cursor change on hover, has_focus = false on mouse click

Now I should actually make them resize when dragged, aye?

* Very basic gizmo resizing, still a WIP, does not work properly yet

* Start replacing the array of selected pixels with a BitMap

This should optimize the selection making a lot, and it also allows for easy border drawing without having to deal with polygons, thanks to the MarchingAntsOutline.shader

Still commit is still a WIP, image effects and brushes may not work properly yet.

Because the BitMap has a fixed size, the size of the project, moving the selection outside of canvas boundaries has proven to be a bit tricky. I did implement a hacky way of handling it, but it may be buggy and problematic. I'm still unsure whether this is the best way to handle the situation.

* Selection works with mirror view

* Draw a black rectangle when the user is making a rectangular selection

After they release the mouse, the black rectangle becomes the selection

* Make Selection.gd update when undoing/redoing

* Fix brushes not working properly with non-rectangular selections

* Added invert selection

* Cache has_selection as a variable for a speedup

* Fix conflict issues with the shape tools

* Made the bitmap image squared so the marching ants effect will be the same on both dimensions

There may be a better way to fix the issue, perhaps inside the shader itself.

* Some optimizations to call selection_bitmap_changed() less times

* Restored almost all of the image effects

Left to do:
- Change gradient's behavior. Unsure of how it will work with non-rectangular selections yet, but it should not generate pixels outside of the selection.
- Restore rotation
- Resize bitmap on image resize
- Remove the `pixels` array from the ImageEffect

* Fix Selection.gd not updating when changing project

* Resize the selection bitmap along with image resize

* Restored rotation's old behavior and finally got rid of the selected_pixels array

The rotation does not yet work properly with selections, but at least it now "works".

* Resize selection too when using gizmos

Left to do for gizmos:
- Proper cancel transformation
- Begin transformation
(currently named move_content_start but it should be renamed to something more general) when resizing gizmos
- Keep the original image and selection in memory and resize them. Meaning, gizmos should not resize the already resized data, but only resize the original. This is less destructive as there is no danger of data loss.
- Always resize on InputEventMouseMotion. This is going to be worse for performance, but it will look better for the user.

* Image and bitmap resizing now uses the original data and begin transformation on gizmo click

No matter how many times the user resizes on the current transformation, the original data will not be lost until they either confirm or cancel, so there is no data loss before confirmation/cancel.

* Cancel transformation now works properly when the selection has been resized

* Made gizmos resize on mouse motion, fix issues with negative bounding rectangle and when combined with the move tool

* Resizing can now get out of positive bounds, clearing and inverting now gets limited to the canvas bounds

Resizing currently does not work properly with negative (left & up) canvas boundaries

* Flip image when resizing and the bounding rectangle gets flipped

* Call move_content_confirm() when inverting selection

* Attempt to implement selection resizing that goes outside of the canvas boundaries (not working properly yet)

* Flip selection when resizing to negative bounding rectangle sizes

And fix preview_image vertical flipping

* Fix rotation so that it works (almost) properly with selections

Rotation algorithms now accept and only work with a given image, and the pivot has been added as a parameter

* Experimental gizmo rotation - does not work properly yet

Transforming the selection outside of the canvas is still broken.

* Fix some issues with moving selection out of canvas bounds

* Fix more issues with selection getting resized outside of canvas bounds

* Update marching ants effect properly when switching between projects

And make sure the frequency of the marching ants effect always looks roughly the same on all project sizes

* Made the rotation gizmo part of the gizmos array and resize them based on camera zoom

* Remove unneeded parameter from move_bitmap_values()

* Remove more unneeded parameters

* Move the selection only if the cursor is above it and neither shift nor control are currently pressed

* Gradient generation now works on non-rectangular selections

Although this behavior might not be the intended one

* Copy/paste marching ants effect offset

Useful for when the selection is in negative coords

* Fix issue with clear selection & UndoRedo

* Restore the ability to move selection when it's in negative coords

* Made the marching ants offset a Project variable

This fixes the issue of project switching and keeping the previous project's offset. Again, this is only relevant for when the selection is in negative coords.

* Made the "from current selection" palette preset work with the new selection system

* Fix out of bounds error when using the rectangular select tool on negative coords

* Some code cleanup

* Comment out the rotation gizmo for now, since it does not work properly

* Update marching ants shader params and gizmo sizes when the bitmap changes

* Move some methods around in Selection.gd
2021-04-17 11:30:12 -07:00
Manolis Papadeas 0c54470209 Update CHANGELOG & AboutDialog 2021-04-16 22:07:38 +03:00
Manolis Papadeas bcc0d359dc Restored LightenDarken's previous behavior
Fixes a minor issue from 6cce27a360
2021-04-16 21:47:03 +03:00
Manolis Papadeas f321b6d101 Remove paths from Main.tscn from the palette PR 2021-04-16 21:17:23 +03:00
Martin Novák 42696e7b37
Replace old palette system with a new one (#447)
* Replace old palette system with a new one

* Replace default json palettes with new resource versions

* Add missing translation strings

* Fix Erevoid's issues 2, 3 and 4

* Rewrite palette grid to improve performance
Add middle click scrolling

* Fix index conversion functions

* Fix palettes editing by copying them to XDG user write path

* Add Windows specific fixes

* Add import support for old json palette format

* Add create/edit palette settings check.
Hide add/delete color buttons when no palette is displayed.
2021-04-16 11:09:03 -07:00
kevinms 05eda55bc7
Fix hue and saturation getting reset when draging value slider to zero (#473) 2021-04-01 16:13:54 -07:00
Manolis Papadeas 6cce27a360 Do not run update_mask() method if there is no pressure sensitivity option
Major speedup for large images. update_mask() is meant for pen pressure only, so there is no reason to calculate it if we don't have pressure sensitivity enabled
2021-04-01 03:40:35 +03:00
DragonOfWar 943a69c0e3
Add Rectangle and Ellipse tools (#456)
* Add Shapes Tool (WIP)

* Add Alt button + Fill shape + Other stuff

* Add blue theme button textures

* Fix tool not previewing on right button

* Add config functions

* Fix ellipse bug

* Correctly added thickness

* Keep preview with CTRL

* Fix weird PoolVector behaviour

* Make preview follow mouse when pressing CTRL

* Moved shapes class to a separate script

* Update tooltip

* Enable mirrors

* Separate tools + jittery preview fix + more

* Add missing translation

* Add missing icons and keybindings

* Changed shape draw function buttons

Co-authored-by: DragonOfWar <47753585+KawanWeege@users.noreply.github.com>
2021-03-30 10:07:13 -07:00
Manolis Papadeas a9045e317d Apply mirror view to all tools 2021-03-29 23:00:09 +03:00
Manolis Papadeas 5a0e80b1cf Update Translations.pot 2021-03-28 02:14:59 +02:00
Manolis Papadeas c577d0724c
New Crowdin updates (#451)
* New translations Translations.pot (Polish)

* New translations Translations.pot (German)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Ukrainian)

* New translations Translations.pot (Ukrainian)

* New translations Translations.pot (Ukrainian)

* New translations Translations.pot (Spanish)

* New translations Translations.pot (Romanian)

* New translations Translations.pot (French)

* New translations Translations.pot (Polish)

* New translations Translations.pot (French)

* New translations Translations.pot (Russian)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Russian)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Romanian)

* New translations Translations.pot (French)

* New translations Translations.pot (Spanish)

* New translations Translations.pot (Afrikaans)

* New translations Translations.pot (Arabic)

* New translations Translations.pot (Catalan)

* New translations Translations.pot (Czech)

* New translations Translations.pot (Danish)

* New translations Translations.pot (German)

* New translations Translations.pot (Greek)

* New translations Translations.pot (Finnish)

* New translations Translations.pot (Hebrew)

* New translations Translations.pot (Italian)

* New translations Translations.pot (Japanese)

* New translations Translations.pot (Dutch)

* New translations Translations.pot (Esperanto)

* New translations Translations.pot (Norwegian)

* New translations Translations.pot (Polish)

* New translations Translations.pot (Portuguese)

* New translations Translations.pot (Serbian (Cyrillic))

* New translations Translations.pot (Swedish)

* New translations Translations.pot (Turkish)

* New translations Translations.pot (Ukrainian)

* New translations Translations.pot (Chinese Simplified)

* New translations Translations.pot (Chinese Traditional)

* New translations Translations.pot (Vietnamese)

* New translations Translations.pot (Portuguese, Brazilian)

* New translations Translations.pot (Indonesian)

* New translations Translations.pot (Latvian)

* New translations Translations.pot (Hindi)

* New translations Translations.pot (Greek)

* New translations Translations.pot (Japanese)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Chinese Simplified)

* New translations Translations.pot (Romanian)

* New translations Translations.pot (Italian)

* New translations Translations.pot (German)

* New translations Translations.pot (Russian)

* New translations Translations.pot (Dutch)

* New translations Translations.pot (Hindi)

* New translations Translations.pot (Latvian)

* New translations Translations.pot (Indonesian)

* New translations Translations.pot (Portuguese, Brazilian)

* New translations Translations.pot (Vietnamese)

* New translations Translations.pot (Chinese Traditional)

* New translations Translations.pot (Chinese Simplified)

* New translations Translations.pot (Ukrainian)

* New translations Translations.pot (Turkish)

* New translations Translations.pot (Swedish)

* New translations Translations.pot (Serbian (Cyrillic))

* New translations Translations.pot (Portuguese)

* New translations Translations.pot (Polish)

* New translations Translations.pot (Norwegian)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Japanese)

* New translations Translations.pot (Italian)

* New translations Translations.pot (Hebrew)

* New translations Translations.pot (Finnish)

* New translations Translations.pot (Greek)

* New translations Translations.pot (German)

* New translations Translations.pot (Danish)

* New translations Translations.pot (Czech)

* New translations Translations.pot (Catalan)

* New translations Translations.pot (Arabic)

* New translations Translations.pot (Afrikaans)

* New translations Translations.pot (Spanish)

* New translations Translations.pot (French)

* New translations Translations.pot (Romanian)

* New translations Translations.pot (Esperanto)

* New translations Translations.pot (Greek)

* New translations Translations.pot (German)

* New translations Translations.pot (Italian)

* New translations Translations.pot (Polish)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Hungarian)

* New translations Translations.pot (Korean)

* New translations Translations.pot (Korean)
2021-03-21 13:12:56 -07:00
Manolis Papadeas cffba7edde Added an option in the Preferences for interface dimming on dialog popup 2021-03-17 19:28:01 +02:00
Manolis Papadeas b26be782c1 Made the splash screen fully opaque again 2021-03-17 19:17:26 +02:00
Manolis Papadeas 82b1535c14 Update CHANGELOG 2021-03-17 18:15:43 +02:00
Manolis Papadeas 810affb1bc Update CHANGELOG & Translations, clear whitespaces 2021-03-15 03:41:02 +02:00
ballerburg9005 de164ea9de
full support for auto tallscreen/widescreen panel layout (#458)
* full support for auto tallscreen/widescreen panel layout

* Update Main.tscn

* Update CanvasPreviewContainer.tscn

* Update UI.tscn

* tallscreen support - better display scale

* tallscreen support - better display scale

* Update UI.tscn

* Update Main.gd

* tallscreen support - better display scale

* tallscreen support - better display scale

* tallscreen support - alternate panel placement comment-784228607

* tallscreen support - code cleanup

* tallscreen support - color picker swap: comment-785032683

* prettier border

* tallscreen support - color picker

* tallscreen support - pullrequestreview-601156079

* tallscreen support - bugfix & review

Co-authored-by: ballerburg9005 <mathias.steiger@gmail.com>
2021-03-06 05:59:26 -08:00
Manolis Papadeas 35f97ebe6f
Fix issue where the window regains focus and draws immediatly
The issue occurred when the cursor exited the application window very fast while still on the canvas, thus Global.has_focus was still true, then lost focus. When Pixelorama regained focus, it would draw the tool even if the user clicked outside of the drawing canvas.
2021-02-25 07:00:50 -08:00
gamesplease 59862171e9
Add keyboard shortcut for Clear Selection (#457) 2021-02-17 09:53:01 -08:00
Variable f9c275d0a4
"SpriteSheet as layer" and "Replace Frame" import options (#453)
* fixed some more bugs

* Removed some more bugs

* Added "Replace Frame" option

It was originally made to use primarily in "Spritesheet (new layer)" but it thought it could also be useful to put it there as an import option

* Update PreviewDialog.tscn

* Update PreviewDialog.gd

* Update OpenSave.gd

* added import option for SpriteSheet and Frame

Now we can add SpriteSheets in current project and Replace frames in current project

* added functions for SpriteSheet and Frames

I added functions that would allow me to add SpriteSheet as new Layer. I also added an option for "Replace frame" (the function "open_image_at_frame()" is originally being used in "open_image_as_spritesheet_layer()" method but i decided to use it as an import option as well)

* Changed contribution name

* Changed contribution name

* Fixed some lines

* fixed sprite lines not updating
2021-02-07 06:43:44 -08:00
THWLF 45be4ee6b7
Added more standart devices from 8/16Bit era (#450) 2021-02-05 03:05:08 -08:00
Manolis Papadeas 1612346319
New Crowdin updates (#400)
* New translations
2021-02-03 17:20:30 -08:00
Manolis Papadeas d5f8d8e899 Disable Window Transparency in the Web version, update CHANGELOG & Translations 2021-02-02 19:17:56 +02:00
Manolis Papadeas ce7320ad4f Renamed "Base" to "BaseTool" and made it a class 2021-02-02 17:48:17 +02:00
Variable dc469dd4b5
Var transparent mode (#444)
* allowed and enabled per_pixel_transparency

* Added a Transparency menu

* Added an Alternate screen for transparency

* Added transparency methods

Added the transparency methods plus modified fullscreen such that it resets transparency on toggling hence, Removing the issue of blackness

* Modified the shader to allow transparency

* Added a material to ViewportContainer

Fixed the bug that darkens image when decreasing opacity

* Update Global.gd

* Update Main.gd

* Update TopMenuContainer.gd
2021-02-02 07:29:19 -08:00
Manolis Papadeas 40f6a24fdc Made Zoom tool work on the second viewport too 2021-02-01 21:07:09 +02:00
Manolis Papadeas 097367ac45 Added a missing comma on a string 2021-02-01 17:48:28 +02:00
Manolis Papadeas c54b74f829 Having no active selection no longer treats all the pixels of the canvas as selected
A performance boost for when opening large images. Also fixed an issue with pixels being selected outside of the canvas boundaries, when the selection rectangle was outside the canvas and its size got reduced.
2021-01-31 15:09:54 +02:00
Manolis Papadeas 7f1594e1bc You can now resize cels in the timeline by holding Control and scrolling with the mouse wheel.
Addresses part of #306
2021-01-30 23:57:33 +02:00
Manolis Papadeas 77185b5263 Update tile mode rects when importing a project 2021-01-30 20:43:10 +02:00
Manolis Papadeas 5b3b91b247 Fix #445 by NOT replacing empty backups 2021-01-30 20:33:00 +02:00
kleonc 499251f44a
Fix potential index out of bounds error (#446) 2021-01-30 09:30:02 -08:00
Manolis Papadeas 27852b2694 Dragging and dropping individual cels in the timeline to change their position is now possible.
Addresses a part of #306
2021-01-29 22:00:48 +02:00
kleonc 4001a32f2b
Cache tile mode rects (#443)
* Cache tile mode rects

* Make TransparentChecker don't calculate tile mode rect on its own

* Minor fixes

- typo
- formatting
- moved unlock() call to the method where matching lock() was called
2021-01-28 11:21:48 -08:00
Manolis Papadeas 4db21dae95 ScaleImage dialog improvements
It now automatically sets the size to the current project's size, has a button to lock aspect ratio, and resizing based on percentage. Some UI changes to CreateNewImage too.
2021-01-27 00:45:12 +02:00
Manolis Papadeas 6edfbad663 Fixed a bug with the Zoom tool, removed Godot's version check from Tools.gd and updated AboutDialog, CHANGELOG and Translations 2021-01-26 16:34:25 +02:00
Variable eff0adbf21
Var pix centralize (#441)
* Added Centralize Image

* Add files via upload

* Added Centralize Image (fixd some lines)

* Added Centralize Image (fixes some lines)

* Fixed and removed some lines

* Fixed and removed some lines

* Removed unnecessary parameters

* Removed unnecessary parameters

* Update DrawingAlgos.gd
2021-01-26 06:03:38 -08:00
Manolis Papadeas 93bbfabb99 Refactored CreateNewImage dialog and added portrait & landscape buttons from #402
The lock aspect ratio button has been changed from a checkbox to a texture button and the template code has been refactored to use a Template class instead of enums. Only dark icons have been added for now.
2021-01-25 22:07:02 +02:00
Manolis Papadeas 6cb525ad92 Update changelog & AboutDialog 2021-01-23 00:27:28 +02:00
Manolis Papadeas f03dcfe230 Made Pan tool's shortcut change-able, and added missing translations 2021-01-21 01:58:15 +02:00
kleonc 85b0611ca0
Speedup Draw.update_mask() (#439) 2021-01-20 13:29:40 -08:00
kleonc 63838964b3
Renamed enums to follow recommended naming convention (#437) 2021-01-20 06:59:42 -08:00
Manolis Papadeas f189cef78d Fixed mistake in Translations.pot 2021-01-20 16:22:28 +02:00
kleonc eeb97f71e4
One shared offset for rectangular and isometric grids, added "Draw Grid over Tile Mode" toggle (#434)
* One shared offset for rectangular and isometric grids

* One draw call per grid

* Added "Draw Grid over Tile Mode" toggle
2021-01-19 16:17:33 -08:00
Manolis Papadeas c60fb0632e
Fixed macOS butler deployment in release workflow 2021-01-18 17:22:00 -08:00
kleonc 9c520a65e9
Refactored isometric grid (#430)
* Move get_tile_mode_rect() method to the Project class

* Refactored isometric grid

Now it should be drawn properly in the target rect.
Settings (in pixels):
- cell's AABB size,
- offset from the canvas origin.
2021-01-18 12:59:26 -08:00
Manolis Papadeas 9f8c9807e7 Replaced pan tool icons
The previous icons made by Schweini in #399 will be used for the new move tool.
2021-01-17 21:46:15 +02:00
Manolis Papadeas abe5f6ff62
Fix broken links in CONTRIBUTING.md 2021-01-17 10:56:00 -08:00
kleonc db9980a883
Draw Grid only over Canvas. Added PixelGrid. (#427)
* Draw grid only over the Canvas (when in tiling mode)

* Replace some magic numbers with enums.

It's too easy to break something when adding something new in here. Should be a little harder now.

* Added Pixel Grid.

- Pixel grid is shown only when it's enabled and camera is zoomed close enough.
- Settings: pixel_grid_show_at_zoom (as a percentage because that's what's shown in the settings panel), pixel_grid_color. Default values might need changing.
- To distinguish between grid and pixel grid default settings for grid width, grid height are changed.
- Now both grid and pixel grid are drawn above (after) tile mode. Grid is drawn above (after) pixel grid.
2021-01-16 10:24:46 -08:00
Manolis Papadeas 4da4f4ebb8 If it's trying to load a theme that doesn't exist, default to the first theme
Useful for cases where a user uses a version with a theme, and goes to a previous version where that theme does not exist
2021-01-10 18:20:17 +02:00