GithubHelp home page GithubHelp logo

naclcaleb / draw Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 233 KB

An online drawing program

Home Page: https://naclcaleb.github.io/Draw/

License: GNU General Public License v3.0

JavaScript 59.54% HTML 38.07% SCSS 2.39%
art brush drawing html javascript

draw's People

Contributors

dependabot[bot] avatar naclcaleb avatar oops-studio avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

samsgates

draw's Issues

`python -m SimpleHTTPServer` command not working

In you README.md file, you state to run the python -m SimpleHTTPServer or run on an apache server (which is not an option). Is there something I need to configure to run the command?

This is the output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\rocke\Desktop\Draw> python -m SimpleHTTPServer
C:\Users\rocke\AppData\Local\Programs\Python\Python37-32\python.exe: No module named SimpleHTTPServer
PS C:\Users\rocke\Desktop\Draw>

Implement Zoom on Scroll

I need the canvas to zoom in and out when you scroll. I've tried a few ways, such as editing the CSS transform: scale() rule from my JavaScript, and also increasing the width and height of the elements. The former worked perfectly, except that the mouse coordinates then got confused.

Code needs cleaning

This code needs to be cleaned up - beautified, formatted, and comments added.

Having to undo all redos.

When I undo 4 times, and then redo 4 times, and then undo 4 times, all's good. However, if I undo 5 times and then redo 10 times, then I have to undo 5 times before the undos will start doing anything! :) I'll start working on that now! :)

Problem undoing/redoing

So, I have a weird problem... When I undo and then redo and then try to undo again, it doesn't do anything. If I try to undo enough times then the screen starts to flash, and then the whole drawing disappears... Hope we can find a fix for this! ;) (More like, you find a fix if I'm not successful in the next 5 seconds! ;3) (Sorry for all the sarcasm... If you don't like it, I'll stop! ๐Ÿ‘ )

Ctrl+Z Undo breaks Eraser Strokes

If you draw a stroke, then erase part of it, then draw another thing, and then use Ctrl+Z to undo, the eraser stroke gets a fill, and is no longer erasing.

Draws while changing options

Say you zoom in on a small part of the canvas. When you change the brush color, size, or opacity, it's drawing on the canvas right through the options panel!!

Add Multiple Layer Support

This is a slightly more robust issue to deal with, but I've got all the infrastructure built in.
Basically it needs to have a UI somewhere out of the way but also easily available, and then in the code, a layer can be added by calling canvas.push(new Layer(CANVAS_WIDTH, CANVAS_HEIGHT)) somewhere in index.js. Then the active layer can be switched by changing the global variable ACTIVE_LAYER to the appropriate index in the canvas.layers array.

Add Redo support

Currently I have the "undo" command working with the shortcut Ctrl+Z, but it doesn't do redo.

I already have all the infrastructure for handling redos though. The "Layer" class stores an "undone" array that is updated whenever "undo" is called. All you have to do to add the feature is add a key listener for Ctrl+Y, and when that happens, do the following:

  1. Put the first element in the "undone" array into the "strokes" array (this is inside the Layer class, so they'll be this.undone and this.strokes). The first element should be deleted from the undone array.

  2. Now call the updateRender function on the Layer class (this.updateRender()).

@OOPS-Studio, I was wondering if you might want to take this up?

Undoing Eraser stroke erases entire drawing

If you make a regular stroke, then use an eraser stroke, then press Ctrl+Z, the entire drawing disappears. The culprit is probably some sort of a ctx.globalCompositionOperation reset I forgot to do.

Package.json and project info not matching

Isn't the package.json supposed to have the same information as the Draw project? The package.json has the project of mdl-select-component and the repo has information of Draw, should I change the information to match this current repo? I could open it in a new pull request.

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.