Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NiklasRentzCAU opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working LSP Affect the klighd language server.

Comments

@NiklasRentzCAU
Copy link
Member

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
    }
  }
}
@NiklasRentzCAU NiklasRentzCAU added bug Something isn't working LSP Affect the klighd language server. labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LSP Affect the klighd language server.
Projects
None yet
Development

No branches or pull requests

1 participant