Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CALayer Methods "setContents" and "Contents" not working as expected #1419

Open
tuxedout opened this Issue · 5 comments

6 participants

tuxedout Adam Radabaugh CappBot Aparajita Fishman Nicholas J. Small Francisco Ryan Tolmasky I
tuxedout

I'm working on a project which requires small thumbnails of document pages (like thumbnails of layers in Photoshop), it has a main work area which is represented as CALayer. Implementation is done using http://cappuccino.org/learn/documentation/interface_c_a_layer.html for reference. As declared in this doc "CALayer" has "setContents" and "contents" methods, but when I try to use them I get these problems:setContents - does nothingcontents returns nullBut I do not see any errors or warnings in js-console.Are these bugs in these mmethods?Can these methods be used to extract layer thumbnails for use in other layers?

Adam Radabaugh

Do you have any sample code? I am unable to reproduce. In my testing, the methods themselves DO seem to be working correctly but I wonder if in your context a bug is being inadvertently triggered.

tuxedout

Hello, I urgently need help with this

Code example:

        var curLayer = [CALayer layer];

        for (i=0;i<[layers count];i++){
            [curLayer addSublayer:layers[i]];
        }

        [curLayer setAffineTransform:CGAffineTransformMakeScale(coef,coef)];

        [tmpIV setLayer:curLayer];

        console.log([curLayer contents]);

This code returns null, also I found another problem:

        var context = CGBitmapGraphicsContextCreate();

        [curLayer drawInContext:context];

        console.log(context.canvas.toDataURL('image/png'));

Returned base64 encoded image is blank, but curLayer is not blank it contains drawing

Nicholas J. Small nickjs was assigned
Francisco Ryan Tolmasky I tolmasky was assigned
Nicholas J. Small nickjs was assigned
CappBot
Collaborator

Assignee: nciagra. Milestone: Someday. Labels: #needs-confirmation, AppKit. What's next? This issue needs a volunteer to independently reproduce the issue.

Aparajita Fishman
Owner

#needs-reduction

CappBot
Collaborator

Assignee: nickjs. Milestone: Someday. Labels: #needs-confirmation, #needs-reduction, AppKit. What's next?

  • This issue needs a volunteer to independently reproduce the issue.
  • A minimal test app should be created which demonstrates the concern of this issue in isolation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.