jrmuizel / raqote

Rust 2D graphics library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example produces an unexpected result

RazrFalcon opened this issue · comments

This is what I'm getting:

out

What do you expect to get? I don't actually remember what it's supposed to look like.

I though that it suppose to return the one in the readme.

commented

Just cloned raqote and tried to run the examples/capabilities.rs example.
It initially panics because it is trying to open a "photo.png" file that doesn't exist. I changed capabilities.rs to open an "example.png" which does exist and got past the file-not-found panic, but now I've hit a new one:

> cr --example capabilities                                                                                                <(~/r/raqote)
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/examples/capabilities`
RGBA
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', examples/capabilities.rs:71:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


The simple mouse tracking example on crates.io worked for me, so I'm quite excited to get going on some gui stuff with raqote. Any suggestions on how to get examples/capabilities.rs running?

-- A.noob

commented

Just tried the png writing example on crates.io and got this:

Argh! Dragging and dropping, and copy/pasting the png file doesn't seem to work on a Chromebook.

Suffice it to say, the png looks exactly the same as the one attached to the crates.io example.

Falcon, did you paste the example code into a new 'cargo init ' main.rs?
Did you leave the template 'println!("Hello world");' in main?
That might explain the 'Hello' in your png.
Doesn't explain the colors though.

commented

If the PNG you supply is RGBA format, you get the 'index out of bounds' panic @ndearns describes. If it's RGB you get this:
out
No idea why the text isn't advancing properly, it does that with all the examples: each character gets treated as if it's half as wide as it appears.