GithubHelp home page GithubHelp logo

avokicchi / jquery-drawr Goto Github PK

View Code? Open in Web Editor NEW
41.0 41.0 20.0 6.37 MB

JQuery dRawr is a jquery plugin to turn any canvas element into a drawing area with a lot of useful tools and brushes.

License: MIT License

JavaScript 100.00%

jquery-drawr's People

Contributors

avokicchi avatar dependabot[bot] avatar rfuehrer 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

Watchers

 avatar  avatar  avatar  avatar

jquery-drawr's Issues

Issues with undo

Steps to reproduce, draw some, then draw with marker tool, then undo, then draw some, then undo - it seems to undo multiple steps at once.

Support 3d touch

testing needed with force values on iPad - oddly enough the fairphone 3 reports working "force" values as well, but they are unusably low. maybe this is standard? in that case I can multiply and implement.

//TODO: add support for 3D touch of apple and other devices (oddly enough, the fairphone 3 seems to support this) /*if(typeof event.originalEvent.touches[0].force!=="undefined" && force > 0){ this.pen_pressure=true;//this works, but at least on fairphone, the values are too low. testing needed on iOS devices. }*/

drawr does not work in a modal dialog

  • Toolwindows are not showing up when running canvas in modal
  • mouse positioning is wrong in modal
  • helper lines are wrong in modal
  • drawing offsets are calculated wrong in modal
  • everything is wrong in modal

Layers

Just a matter of drawing canvasses on top of eachother. maybe use offscreen canvas.
Could even implement a couple of blend modes like lighten, multiply, darken using whatever we can support with globalCompositeOperation.
Given that we're talking about webbased stuff and mobile support, maybe have a sanity limit of like three layers max.

X and Y offsets are working differently when added in a modal

Hey, I'm trying to use this app in a modal on my page but when I do it, it definitely goes crazy with where I'm clicking and where it's drawing. It is something that would match my expectations so if there's any solution that I can apply, I want to know.

There are left and top parameters for many things in code but not every one of them works okay after I change their left-top value to x-left which left in that line is the left offset of my modal body. Pencil works fine now but it goes crazy when I try to use zoom.

Helpp please

Vertical scrolling amount seems halved on mobile

On desktop it works. On mobile, it works too, but for every 10 pixels scrolled vertically, only 5 seem to happen. Might have to do with cancelled touchmove events and the odd behaviour of rubberbanding on the whole page. maybe I can catch that with document.body.scrollTop and use that as adjustment or something, if that is the case. testing is needed.

take web folder out of package

zip file and website files on the package is kinda dumb and takes unneeded space. instead, create a tests folder, make some seperate demos in there for developers

Clearing the canvas!

can anybody tell me how to clear whole canvas drawings without calling destroy in function?!

Mobile devices inssue

Hello!
First of all, congratulations @lieuweprins for the pluguin, it is awesome and help me a lot.
I used it in a web aplication that I need it can be used by mobile devices. The problem is that seems the plugin is blocking the links and the button of the page... It is rare, you can see it by watching your own web demo (https://rawrfl.es/jquery-drawr/ ) in a mobile device or by toogle device toolbar inside de F12 mode of Chrome. Click in "Download" or "View on github" or the links in the page and you will see it.
Do you know why is this happening?

Thanks you in advance!

inssue drawr

Scrolling breaks text tool

If you scroll the text placement indictator doesnt move along. to fix this, i need a new brush event for when the scroll pos changes. and hide the text thinger on scroll.

scrollbar bugs

the fake scrollbars are incorrect in height and position, and completely break when you zoom.

npm

Hi,

Would be really nice to see this lib on npm.

Missing tools and settings

implement several things (using dropdown)

canvas options: flipx, flipy, rotate, adjust size, crop, background (drop alpha channel)
effects: blur, sepia, grayscale
tools: flood fill, smudge, redo
polygon/rectangular selection

Maybe adjust the default to only have a very small subset of these enabled.

Fairphone 3 drawing is messed up

drawing is kinda messed up due to pressure value. It's like that phone always pretends to be a stylus with low pressure. not sure. investigate.

Filled square functions as eraser

Steps to reproduce a bug:

  1. Open https://rawrfl.es/jquery-drawr/
  2. In the first example draw line with pencil, pen or brush.
  3. Select eraser and erase part of the line you drew in previous step.
  4. Select filled square tool and draw a rectangle into canvas (partly overlapping the line) .

Expected result:

Filled (black) square should be visible in the canvas.

Actual result:

No filled square is visible after your release mouse. Instead, filled square tool functions as an eraser.

Rotate Image Tool

Hi,
Hope you are doing well.
I want image rotate tool in our plugin

minor issue when switching drawing mode

if you scribble with pen, then scribble some with touch, it ignores the first few as expected, but then draws a straight line from the last pencil position to the new touch position.

fullscreen mode

Ability to maximize to fullscreen (using a tool - so optional)

adjust scroll position upon zoom

zooming needs to adjust the scroll position so you keep looking at the same section of the canvas at least on the top left, every drawing program does that.

Alter outside drawing area color

inactive/outside drawing bounds area should be gray, probably. on small images especially it is unclear where the bounds are.

allowed draw area is broken

Since last update all positioning might be right, but if you scroll to the right, it doesn't let you start draw events for some reason.
will fix this later today, should be simple. In order to debug this better, make some indicator that the drawing area is active. change the grid lines color to highlighted, maybe?

easier tool config

Ability to pass an array of tools, as well as having a default toolset rather than loading them automatically
additionally, making ALL tool buttons configurable, currently zoom and undo are not removable
this requires updating all examples

There is a bug while the div gets pulled down within a tabular structure.

I was trying to implement it but found this bug.
My HTML structure is tables based and DIVs have been nested within TDs.
Now say I am trying to implement this at 3rd row i.e 3rd TR.
First, 2 rows have already taken some height, assume some 400px!
So, this drawing tool starts from 400px, and there I found the issue.
I have managed to set the CANVAS, TOOLs everything, but once I tried drawing something, that didn't happen!
So, I started scratching the reason and I found the mouse events have been starting from 0,0 of the parent instead of 400,0. Or better to say, mouse events don't work at the 3rd TR or the CANVAS I had put inside.
Let me know if it's not clear!

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.