Coder Social home page Coder Social logo

minipixel's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Fabio
  • ๐Ÿ‘€ Iโ€™m interested in Zig, graphics programming, games, and pixel art
  • ๐Ÿ“ซ You can reach me on Twitter @captainhorst or on Discord captainhorst#9617

minipixel's People

Contributors

fabioarnold avatar iacore avatar shadeops avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minipixel's Issues

Transformation widget

When having a selection, display handles to allow arbitrary scaling.

  • Only nearest integer scaling
  • Always keep the source image while the selection is active
  • Preview handled in shader

Selection Texture mangled with IndexedBitmap

Howdy!

I was playing with MiniPixel and noticed whenever I select part of the image while in Index mode, the selection texture gets mangled if the selection width is an odd number.

Here is an example gif that alternates between selections with an odd numbered width and an even numbered width.

MiniPixel

I traced through the code a bit to try to track this down but everything seems to be working fine until the IndexBitmap is passed to nanovg. For example,

self.selection_texture = selection.bitmap.createTexture(vg);

selection.indexed_bitmap.indices had the values that I would expect.

This behaviour shows up in Linux and in Windows. Tested on v0.2.1 and the current master, cb255f1.

I'm happy to continue to debug, but just wanted to flag the issue.

Thanks.

Desktop environment freezes in Linux xfce when opening save file dialog window

When I click the save button, the system file dialog opens, but then it is frozen: I cannot click on the button to save or cancel, and all my desktop UI becomes unresponsive to mouse action. I can still do ALT+TAB and the keyboard works, so killing the process via terminal can unfreeze the desktop.

I'm on Linux with xfce desktop.

Other than this so far everything works nicely, great work!

Mark windows for deletion

Don't directly delete windows within a UI event after calling window.close(). Code running during the event handling might try to access the window handle as observed here: e7cd1d9
Instead mark the window for deletion and delete it when event handling is done and not from within an application call stack.

Issues Minimizing Window on Linux

Howdy,

I noticed some issues when trying to minimize MiniPixel on Linux. (MiniPixel is so awesome I hadn't tried to minimize it before now. ๐Ÿ˜„ )

Here is a .gif of what happens when the window's minimize button is clicked.

MiniPixel

The window loses focus but the immediately seems to un-minimize itself. Additionally if I go to another desktop, I can see it show up in the task bar which generally only happens if an application is trying to get attention.

I have zero SDL experience, but my guess is that the SdlWindow.draw() call is sees that the window is hidden and tells the window manager to show it:

MiniPixel/src/main.zig

Lines 261 to 263 in f5f0195

if (c.SDL_GetWindowFlags(self.handle) & c.SDL_WINDOW_HIDDEN != 0) {
c.SDL_ShowWindow(self.handle);
}

I made a small change here, shadeops@9728a1a, which avoids the SdlWindow.draw() call entirely if minimized.

Note - This doesn't appear to be a problem with 0.2.1 on Windows.

OS: Kubuntu 20.04
Head: f5f0195

When picking a color the palette selection isn't cleared

  1. Select e.g. red using the palette
  2. Pick another color from the canvas e.g. blue
  3. The ColorPickerWidget gets updated and red is still selected in the palette
  4. When using the color sliders red from palette gets overwritten with blue

Canvas doesn't update

When using operations other than drawing a pixel or a line such as fill, the canvas doesn't update.

Implement two distinct draw modes

There should be two draw modes

  • Replace - replace pixels on canvas
  • Blend - alpha blend drawn pixels with pixels on canvas

This should affect draw, fill and selection.

Custom grid

Right now we have a pixel grid. An arbitrarily sized meta grid or tile grid would be nice. Also, implement snapping for selection.

Split save action into "save" and "save as"

When clicking the save button store document path. If no path is stored, automatically perform "save as" instead of "save" action.

Ctrl + S: save
Ctrl + Shift + S: save as

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.