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

macOS default drawing size width is huge #172

Closed
ijean opened this issue May 16, 2020 · 7 comments
Closed

macOS default drawing size width is huge #172

ijean opened this issue May 16, 2020 · 7 comments

Comments

@ijean
Copy link

ijean commented May 16, 2020

Hello,

I'm using macOS Catalina, Rust 1.43.1 and turtle 1.0.0-rc.3 with a MacBook Air 2018 (retina display). I think something is wrong with the way the turtle window is created because the default width of the window is huge. Here is a sample program that I've tried:

use turtle::Turtle;

fn main() {
    let mut turtle = Turtle::new();

    turtle.forward(100.0);

    let size = turtle.drawing().size();
    println!("size: {} {}", size.width, size.height);
}

The above claims that the window size is 200000 by 1710 pixels, obviously the line drawn is not visible.

If I force the window to have a specific size nothing seems to change:

turtle.drawing_mut().set_size((400, 500));

Regards,
Jean

@sunjay
Copy link
Owner

sunjay commented May 16, 2020

Hi Jean,
Thanks for reporting this. If you clone the master branch of the repo and run the following command, does the same issue still occur?

cargo run --example circle

This example should draw a full circle on the screen. If the window isn't too big, please try to take a screenshot of what's happening. Thanks!

@ijean
Copy link
Author

ijean commented May 16, 2020

Thanks for your quick feedback, seems to work if I use the master:

test

It seems the problem is present when I use in my Cargo.toml file:

turtle = "1.0.0-rc.3"

I assume the problem will go away once you release 1.0.0-rc.4

@sunjay
Copy link
Owner

sunjay commented May 16, 2020

Hi Jean,
I think this is similar to other issues that have been reported recently. There seems to be a dependency update that was done on master but hasn't been released yet. You can still use the crate by changing the dependency in your Cargo.toml to be as followed:

turtle = {git = "https://github.com/sunjay/turtle"}

Please let me know if this resolves things for you.

@ijean
Copy link
Author

ijean commented May 16, 2020

Thanks, this solved the problem for me!
Suggestion - add the above to the documentation because most novices, like me, will be stuck when using the current 1.0.0.-rc.3.

@ijean ijean closed this as completed May 16, 2020
@sunjay
Copy link
Owner

sunjay commented May 16, 2020

Glad you got it working!

@Rickgg
Copy link

Rickgg commented Nov 13, 2020

Hello,

I'm still having these same problems, even after using the git version. After I try to compile, it says:

error[E0432]: unresolved import `futures_core::core_reexport`
  --> /Users/rick/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.6/src/lib.rs:55:9
   |
55 | pub use futures_core::core_reexport;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `core_reexport` in the root

   Compiling pathfinder_ui v0.5.0
   Compiling pathfinder_renderer v0.5.0
error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `futures-util`.

The examples from the Github repo work otherwise. Any ideas what this could be or how can I remedy it?

@sunjay
Copy link
Owner

sunjay commented Nov 13, 2020

Hi @Rickgg. Sorry to hear you're having trouble. Can you try the solution from this comment: #202 (comment)

This issue is quite old, so the solution I suggested above is outdated. Instead of using the git master branch, try selecting the specific revision I outline in that comment.

If you're still running into problems after that, please open a new issue and provide information like your rust version, your Cargo.lock file, and your operating system information.

Hope that solves the problem for you!

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

3 participants