Skip to content

Calling scalafx.scene.Node.localToParentTransform / localToSceneTransform results in StackOverflow exception #205

Description

@albel727

The problem stems from their definition, e.g.

  def localToSceneTransform: Transform = delegate.localToSceneTransform

But the javafx.scene.Node delegate doesn't have the method localToSceneTransform(). It has getLocalToSceneTransform(). Since this is the case, what scala compiler does instead is applying the implicit conversion of jfxs.Node into scalafx.scene.Node... Yes! Right back into the same Node class we're starting from!... And calls its localToSceneTransform, i.e. the very same function we're in already.

Solution: change definitions to

  def localToSceneTransform: Transform = delegate.getLocalToSceneTransform
  def localToParentTransform: Transform = delegate.getLocalToParentTransform

I'd also advise to investigate whether implicit conversions produced similar recursion bugs in other places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions