GithubHelp home page GithubHelp logo

Initial movement about raphael-sketchpad HOT 8 CLOSED

ianli avatar ianli commented on August 10, 2024
Initial movement

from raphael-sketchpad.

Comments (8)

ianli avatar ianli commented on August 10, 2024

Hi Mike-

I updated the code to Version 0.5. It shouldn't have the initial point problem. To see a demo with v0.5, check out http://ianli.com/sketchpad/

Ian

from raphael-sketchpad.

valenciafan7 avatar valenciafan7 commented on August 10, 2024

I have the same problem. Google Chrome 8.0

from raphael-sketchpad.

crysan avatar crysan commented on August 10, 2024

find
if (tokens.length > 0) {
var token = tokens[0].replace("M", "");
var points = token.split(",");
path.push(["M", parseInt(points[0]), parseInt(points[1])]);

            for (var i = 1, n = tokens.length; i < n; i++) { //san
                token = tokens[i];
                points = token.split(",");
                path.push(["L", parseInt(points[0]), parseInt(points[1])]);
            }
        }

replace

        if (tokens.length > 0) {
            var token = tokens[0].replace("M", "");
            var points = token.split(",");
            path.push(["M", parseInt(points[0]), parseInt(points[1])]);

            for (var i = 3, n = tokens.length; i < n; i++) { //san
                token = tokens[i];
                points = token.split(",");
                path.push(["L", parseInt(points[0]), parseInt(points[1])]);
            }
        }

from raphael-sketchpad.

crysan avatar crysan commented on August 10, 2024

draw error in
self.move = function(e, sketchpad) {
if (_drawing == true) {
var offset = $(sketchpad.canvas()).offset();
_points.push([e.pageX - offset.left, e.pageY - offset.top]);

            _c.attr({ path: points_to_svg() });
        }
    };

smal size in
e.pageX - offset.left

from raphael-sketchpad.

PabloBotnix avatar PabloBotnix commented on August 10, 2024

Has this issue been resolved? Or is there a known fix? I also have this initial point problem, only occurs in firefox but in both mac and windows, as though it plots one point, plots another at 0,0 and then returns, occurs each time the paper is cleared. Also Ians example of 0.5 doesn't appear to work, have tried crysans suggestions but with no luck. I'm pretty sure its related to self.move and the offset but couldn't say exactly whats the cause. Any ideas anyone?

from raphael-sketchpad.

peterkeating avatar peterkeating commented on August 10, 2024

Think I have managed to fix this issue. Check out the fork I have created.

https://github.com/peterkeating/raphael-sketchpad

Also I was having another issue when adding a stroke causing an exception to be thrown from the raphael.js file. Solving this was a simple case of upgrading raphael.js from version 1.4 to 2.1.

from raphael-sketchpad.

miketahani avatar miketahani commented on August 10, 2024

i also have sketchpad code up at https://github.com/miketahani/tendermaps-redux, in case anyone needs it. field tested.

from raphael-sketchpad.

ianli avatar ianli commented on August 10, 2024

Thanks @peterkeating for the fix!

I've updated the code to fix the problem. I only needed to make changes to the Pen object.

from raphael-sketchpad.

Related Issues (13)

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.