Skip to content

Bug: guides not rendering when adding programmatically #86

@SidIcarus

Description

@SidIcarus

Environments

Description

In the demo I have the addGuides button on the right hand side. Upon clicking it, it adds guides in increments of 20 to both the horizontal and vertical guides. These state of guides are found under editor.state.horizontalGuides, editor.horizontalGuides.getGuides(), & editor.moveableLayer.horizontalGuidelines, along with the vertical ones in the vertical named properties; these values are console.logged out after they are modified via addGuides.

The singular element that is generated is snappable to the moveable guides upon clicking the button but the guides have not been rendered. Calling forceUpdate() on either the guides instances does not force them to render(). But, if I interact with the guides before or after clicking the button, the new guides will render once. After that, it goes back to not rendering until I interact with it again.

Is there a way to force it to render programmatically? Or a way to a request modifying (add,remove,move) a guide?

Edit:

It seems like retrieving the innerGuide and calling forceUpdate() does force the rendering. Not sure why the outer one doesn't seem to work.

2nd Edit:

In addition to calling the getInnerGuide().forceUpdate() You'll also need to reload the guides so that you can continue adding guides via the ruler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions