SwapToLayer('background'), foreground becomes blank



  • Hi There,

    I'm having trouble with the swapToLayer.

    I have two layers, my current foreground layer (containing a rectangle) and background layer (containing an oval). if I now run the following

    currentGlyph = CurrentGlyph()
    currentGlyph.swapToLayer('background')
    

    the rectangle is moved to background, but the oval disappears, foreground becomes blank. I had expected that the content of the layers is just swapped, foreground > background and background > foreground.

    Thanks, Martin



  • Hi Martin,
    you might try:

    currentGlyph.flipLayers('Layer_A', 'Layer_B')
    

    hope that helps,
    jo



  • Excellent, thanks.
    That’s what I was looking for!

    Martin


  • admin

    Hi Martin

    • swap will copy the glyph to the destination layer and clear the current layer
    • flip will copy the glyph to the destination and copy from the destination layer back to the current layer

    as you already found out, thanks Jo


Log in to reply