swapToLayer('background'), foreground becomes blank

RoboFont Forums Help / General swapToLayer('background'), foreground becomes blank

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  frederik 5 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6103

    martinplus
    Participant

    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

    #6105

    jo
    Participant

    Hi Martin,
    you might try:
    currentGlyph.flipLayers(‘Layer_A’, ‘Layer_B’)

    hope that helps,
    jo

    #6106

    martinplus
    Participant

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

    Martin

    #6109

    frederik
    Keymaster

    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

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.