Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to latest kineticjs #18

Open
Dawied opened this issue Jan 12, 2013 · 4 comments
Open

upgrade to latest kineticjs #18

Dawied opened this issue Jan 12, 2013 · 4 comments
Assignees
Milestone

Comments

@Dawied
Copy link

Dawied commented Jan 12, 2013

I started using kineticjs 4.2.0 with KineticGWT a while ago. Until now I had to change the following:

  1. The parameters in createAnimation in Kinetic.java have changed in 4.2.0, it now uses 2 parameters instead of an object:

    /**
     * Create an Animation.
     * @param context The context layer (animation takes place on this layer)
     * @param fct A custom drawing function
     * @return An object that can be used to control the animation
     */
    public static native Animation createAnimation(Layer context, Drawable fct) /*-{
        return new $wnd.Kinetic.Animation(
         function(frame) {
            fct.@net.edzard.kinetic.Drawable::draw(Lnet/edzard/kinetic/Frame;)(@net.edzard.kinetic.Frame::new(DDD)(frame.lastTime, frame.time, frame.timeDiff));
          },
          context
        );
    }-*/;
    
  2. getBoxHeight and getBoxWidth in Text class do not exist anymore in kineticjs, the getWidth and getHeight now return the box size.

@letmaik
Copy link
Contributor

letmaik commented Jan 13, 2013

Thanks for those first two bits. Upgrading to a new KineticJS version though is probably better done in a single rush by going through the changelog (in our case from 4.0.2 to 4.2.0, or rather 4.3.0) and adapting everything at once.

@ghost ghost assigned ehoefig Jan 13, 2013
@ehoefig
Copy link
Owner

ehoefig commented Jan 13, 2013

Yup, I agree. Let's do an upgrade to the latest version for the v1.0.0 milestone.

@ArtemGr ArtemGr mentioned this issue Feb 1, 2013
@ArtemGr
Copy link

ArtemGr commented Feb 2, 2013

I think there's no remove(child) in Kinetic.Container anymore, instead one has to call the Node.remove() or Node.destroy()

@ArtemGr
Copy link

ArtemGr commented Feb 2, 2013

In KineticGWT all Nodes are draggable by default. In the newest KineticJS (4.3.1) this leads to undesired behaviour: instead of moving the Container (e.g. Group), KineticJS moves the Node inside the Group. I suggest switching the default to false as it is more in line with the KineticJS and it is easier to turn draggability "on" on the container than to turn it "off" on all the constituents of the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants