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

HitContext doesn't have _applyShadow function. #620

Closed
kzhdev opened this issue Oct 3, 2013 · 7 comments
Closed

HitContext doesn't have _applyShadow function. #620

kzhdev opened this issue Oct 3, 2013 · 7 comments
Assignees
Labels

Comments

@kzhdev
Copy link
Contributor

kzhdev commented Oct 3, 2013

It caused an error in drawHint -> .... -> shap.drawScen, when I set a clip on a layer then called layer.draw().

@ericdrowell
Copy link
Owner

the hit context should not render shadows. This is by design. Can you be more specific as to how you are getting an error? can you copy and paste the exact error you're getting?

@kzhdev
Copy link
Contributor Author

kzhdev commented Oct 3, 2013

My shape has shadow. Here is my code:

layer.setClip([x, y, width, height]);
layer.draw();

  1. Uncaught TypeError: Object # has no method '_applyShadow'
    kinetic.js?t=1380822358:5764http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358
    1. Kinetic.Util.addMethods.drawScenekinetic.js?t=1380822358:5764http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    2. (anonymous
      function)kinetic.js?t=1380822358:5393http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    3. Kinetic.Collection.eachkinetic.js?t=1380822358:506http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    4. Kinetic.Util.addMethods._drawChildrenkinetic.js?t=1380822358:5392http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    5. Kinetic.Util.addMethods.drawScenekinetic.js?t=1380822358:5385http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    6. (anonymous
      function)kinetic.js?t=1380822358:5393http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    7. Kinetic.Collection.eachkinetic.js?t=1380822358:506http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    8. Kinetic.Util.addMethods._drawChildrenkinetic.js?t=1380822358:5392http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    9. Kinetic.Context._clipkinetic.js?t=1380822358:1695http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    10. Kinetic.Util.addMethods.drawHitkinetic.js?t=1380822358:5406http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    11. Kinetic.Util.addMethods.drawHitkinetic.js?t=1380822358:7667http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    12. Kinetic.Util.addMethods.drawkinetic.js?t=1380822358:3583http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    13. addBlockcontroller.js?t=1380822358:268http://localhost:5000/s/scripts/lib/adl/controller.js?t=1380822358

    14. Backbone.View.extend.onBlockDoubleClick
      block-panel-view.js?t=1380822358:80http://localhost:5000/s/scripts/widgets/adl/views/block-panel-view.js?t=1380822358

    15. boundlodash.js?t=1380822358:483http://localhost:5000/s/scripts/lib/lodash/lodash.js?t=1380822358

    16. Kinetic.Util.addMethods._firekinetic.js?t=1380822358:3571http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    17. Kinetic.Util.addMethods._fireAndBubblekinetic.js?t=1380822358:3551http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    18. Kinetic.Util.addMethods._fireAndBubblekinetic.js?t=1380822358:3559http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    19. Kinetic.Util.addMethods._mouseupkinetic.js?t=1380822358:7385http://localhost:5000/s/scripts/lib/kinetic/kinetic.js?t=1380822358

    20. (anonymous function)

      I believe there is a bug somewhere in
      hitCanvas.getContext()._clip(this).

    On Thu, Oct 3, 2013 at 12:31 PM, Eric Rowell [email protected]:

    the hit context should not render shadows. This is by design. Can you be
    more specific as to how you are getting an error? can you copy and paste
    the exact error you're getting?


    Reply to this email directly or view it on GitHubhttps://github.com/HitContext doesn't have _applyShadow function. #620#issuecomment-25640920
    .

@ericdrowell
Copy link
Owner

clipping works correctly in v4.7.2 as far as I can tell. can you create a jsfiddle that demonstrates the problem? I suspect that there's something in your code causing the issue.

@ericdrowell
Copy link
Owner

never mind, I was able to replicate the issue. Clipping isn't working correctly when the container has shapes with shadows. I'll get this fixed up by the next release. Thanks!

@ghost ghost assigned ericdrowell Nov 3, 2013
@builtbybrayne
Copy link

Hey, any progress on this? Or workarounds?

@Hackencrash
Copy link

I get a JS error "Object doesn't support property or method '_applyShadow'" in IE & Chrome Win 8.1 in v4.7.4.js at line 5778

context.applyShadow(this);

@lavrton
Copy link
Contributor

lavrton commented Mar 7, 2014

I tested with latest KineticJS version. Works as expected: http://jsbin.com/dixup/1/edit

@lavrton lavrton closed this as completed Mar 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants