Code Monkey home page Code Monkey logo

pentool's Introduction

Paper.js Editor

Vector graphics editor with programmable pen tools aiming to be alternative to de facto standards on graphic design tools. This tool is built deeply based on Paper.js. I'd like to take over the phillosophy of [Scriptgrapher].

Developemnt

git clone https://github.com/baku89/paper-editor
cd paper-editor
yarn install
yarn dev

TODO

  • Enable path editing
  • custom shapes
  • Add snapping profile (abstracted method of snapping and smart guides)
  • Key/multitouch/MIDI/OSC assignment on tool parameters
  • Custom hook funcitons for cursor events (grid snapping, perspective grid, smoothening mouse movement)
  • Path constraints like CAD tool
  • Project variables

LICENSE

This repository is published under an MIT License. See the included LICENSE file.

pentool's People

Contributors

baku89 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  avatar  avatar  avatar

pentool's Issues

Touch Events Not Working

I have an Asus VivoBook Flip 14 and when I try drawing your app doesn't draw. The only time it does is if I don't use the touch screen and just use my mouse.

Collapse code on small screens

Hi!

This is an awesome idea and is working really well using my mouse on a laptop.
However, I really want to try this out on my mobile devices with pen support to see how it feels.
If I try loading it on a phone the view gets messed up because it's trying to fit the code along side the drawing area.
It'd be nice if the code view could be toggled so that you could have more space for writing, and to have it auto-hide on small screens.

Thanks for making this! I think it'd be a great way to teach artistically-minded people how to code. :D

Pinch-zoom / Pinch-rotate for Safari (& Mobile)

Issue #3 reminded me of my codepen, which I recently updated to include Safari gestures. Which means support for Safari desktop browser and Safari Mobile on iOS.

See: https://codepen.io/nexii/pen/mzyLYJ

There is:

document.addEventListener('gesturestart', onGesture);
document.addEventListener('gesturechange', onGesture);
document.addEventListener('gestureend', onGesture);

You can use event.scale and event.rotation. If I remember correctly:

  • Scale 1.0 is based on gesturestart, this is a uniform multiplier
  • Rotation 0.0 is based on gesturestart and the value is in degrees

Official documentation is available at: https://developer.apple.com/documentation/webkitjs/gestureevent

Misc feedbacks from @jimmygunawanapp

  • Audio sometimes does not go away, need to be able to easily remove and import new songs
  • Maybe simpler TimeLine start and end control
  • Help Documentation and also shortcuts can be handy

Pinch-zoom on trackpads in modern browsers causes entire window to zoom

Hi,

There is an issue with the pinch-zoom at:

pentool/src/app.vue

Lines 176 to 187 in d00d1cd

this.canvas.addEventListener("mousewheel", e => {
const view = paper.project.view;
if (e.altKey || e.ctrlKey) {
const zoomDelta = 1 + -e.deltaY / 100;
const pivot = new paper.Point(e.x, e.y); //view.projectToView(new paper.Point(e.x, e.y))
view.scale(zoomDelta, pivot);
view.emit("zoom", view.scaling.x);
} else {
view.translate(-e.deltaX, -e.deltaY);
}
});

Namely that without a e.preventDefault(); the entire page is zooming instead of only the artboard view.

To fix this, we need to add e.preventDefault();, but also addEventListener accepts a third argument for options, one of those event listener options is passive; This is enabled by default in modern browsers for performance reasons, so:

.addEventListener(e => โ€ฆ, { passive: false });

You can see an example of mousewheel listener here: https://codepen.io/nexii/pen/mzyLYJ

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.