Skip to content

KRenderingRefs with multiple nested renderings calculate wrong micro layout in diagram server #223

@NiklasRentzCAU

Description

@NiklasRentzCAU

The following KGraph does not render properly in the LSP version, but does render correctly in the Eclipse version. Comparison images below.

This graph uses a rendering library and rendering refs to put a crosshair with point-based placement inside the referenced rendering into a rectangle. The LS variant does only render the first line of the crosshair at the correct position, the others not. This issue does not happen when using the Eclipse version and also not when replacing the rendering ref with a copy of the rendering itself (second half of the KGraph).
It also does not matter which one is the first rendering, only that one will work and the other renderings are misplaced, also after switching the renderings around, only the first one listed is correct.

crosshair

kgraph crosshair

krenderingLibrary {
  kpolyline line {
    points: left 0, top 0; left 24, top 0
  }

  krectangle crosshair {

    // left reference line
    krectangle {
      styles: invisible=true
      pointData:
        referencePoint = left 2, top 30
      krendering* line
    }

    // top reference line
    krectangle {
      styles: 
        invisible=true
        rotation=90(anchor=left 0, top 0)
      pointData:
        referencePoint = left 30, top 2
      krendering* line
    }

    // right reference line
    krectangle {
      styles:
        invisible=true
      pointData:
        referencePoint = right 2, bottom 30 horizontalAlignment=right
      krendering* line
    }

    // bottom reference line
    krectangle {
      styles: 
        invisible=true
        rotation=270(anchor=left 0, top 0)
      pointData:
        referencePoint = right 30, bottom 2
      krendering* line
    }
  }
}

// This one only renders the first sub-rendering of the crosshair correctly, all others seemingly ignore the crosshair rendering's pointData attributes. (In klighd-vscode. The Eclipse version does not have this problem.)
knode crosshair_library {
  size: width = 60 height = 60
  krendering* crosshair
}

// This is the exact same rendering, without the indirection of the rendering ref. This one works just as expected.
knode crosshair_plain {
  size: width = 60 height = 60
  krectangle crosshair {

    // left reference line
    krectangle {
      styles: invisible=true
      pointData:
        referencePoint = left 2, top 30
      krendering* line
    }

    // top reference line
    krectangle {
      styles: 
        invisible=true
        rotation=90(anchor=left 0, top 0)
      pointData:
        referencePoint = left 30, top 2
      krendering* line
    }

    // right reference line
    krectangle {
      styles:
        invisible=true
      pointData:
        referencePoint = right 2, bottom 30 horizontalAlignment=right
      krendering* line
    }

    // bottom reference line
    krectangle {
      styles: 
        invisible=true
        rotation=270(anchor=left 0, top 0)
      pointData:
        referencePoint = right 30, bottom 2
      krendering* line
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    LSPAffect the klighd language server.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions