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

Add a canvas example #58

Merged
merged 6 commits into from
Feb 4, 2019
Merged

Conversation

barzamin
Copy link
Member

@barzamin barzamin commented Jan 13, 2019

fixes #24. the example just renders the following:
2019-01-12-06

/cc @pomettini (you wanted to know about this ~12 days ago. sorry! hopefully this is a good reference)

@pomettini
Copy link

Thanks a lot for remembering, @barzamin, much appreciated! Will try it right away! 😄

@barzamin
Copy link
Member Author

issue on win systems: uiDrawFillModeWinding is an enum value of type c_int; I think some MSVC typedefs don't match the way stuff works on *nix. best possible fix: stop using raw enum values from the -sys crate and actually write a draw mode enum.

error[E0308]: mismatched types
   --> iui\examples\canvas.rs:17:35
    |
 17 |         let path = Path::new(ctx, uiDrawFillModeWinding);
    |                                   ^^^^^^^^^^^^^^^^^^^^^ expected u32, found i32
 
error[E0308]: mismatched types
   --> iui\examples\canvas.rs:30:35
    |
 30 |         let path = Path::new(ctx, uiDrawFillModeWinding);
    |                                   ^^^^^^^^^^^^^^^^^^^^^ expected u32, found i32

iui/src/draw/path.rs Outdated Show resolved Hide resolved
iui/src/draw/path.rs Show resolved Hide resolved
@barzamin
Copy link
Member Author

barzamin commented Feb 1, 2019 via email

@barzamin
Copy link
Member Author

barzamin commented Feb 4, 2019

cc @NoraCodes

@NoraCodes
Copy link
Collaborator

Awesome, thank you!

@NoraCodes NoraCodes merged commit 684b545 into rust-native-ui:master Feb 4, 2019
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

Successfully merging this pull request may close these issues.

Examples for using DrawContext
3 participants