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

context.nim(572, 10) Error: type mismatch #156

Open
mantielero opened this issue May 20, 2021 · 1 comment
Open

context.nim(572, 10) Error: type mismatch #156

mantielero opened this issue May 20, 2021 · 1 comment

Comments

@mantielero
Copy link

Compiling the areas example with the latest fidget:

$ nim c areas
....
/home/jose/src/nimlang/fidget-master/src/fidget/opengl/context.nim(572, 10) Error: type mismatch: got <Image, Rect, float32, ColorRGBA, float32>
but expected one of: 
proc strokeRoundedRect(image: Image; rect: Rect; nw, ne, se, sw: float32;
                       color: SomeColor; transform: Vec2 | Mat3 = vec2(0, 0);
                       strokeWidth = 1.0)
  first type mismatch at position: 4
  required type for ne: float32
  but expression 'rgba(255, 255, 255, 255)' is of type: ColorRGBA
proc strokeRoundedRect(image: Image; rect: Rect; radius: float32;
                       color: SomeColor; transform: Vec2 | Mat3 = vec2(0, 0);
                       strokeWidth = 1.0)
  first type mismatch at position: 5
  required type for transform: Vec2 or Mat3
  but expression 'weight' is of type: float32
3 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them

expression: strokeRoundedRect(image, rect(weight / 2, weight / 2, rect.w - weight,
                              rect.h - weight), radius,
                  rgba(255, 255, 255, 255), weight)
@mantielero
Copy link
Author

mantielero commented May 20, 2021

I fixed it by replacing this with (adding the transform required by pixie):

image.strokeRoundedRect(
  rect(weight / 2, weight / 2, rect.w - weight, rect.h - weight),
  radius,
  rgba(255, 255, 255, 255),
  vec2(0,0),
  weight
)

I wonder if it would be better to put the weight ahead of the transform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant