-
Notifications
You must be signed in to change notification settings - Fork 567
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
Piet 0.2 #1143
Conversation
50c0743
to
7c6759b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this looks good to me, just a few things inline. Thanks, this is a big chunk of work.
Cargo.toml
Outdated
@@ -12,3 +12,6 @@ default-members = [ | |||
"druid-shell", | |||
"druid-derive", | |||
] | |||
|
|||
[patch.crates-io] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this won't be committed, but rather there will be a piet 0.2 release? I can also appreciate being able to work off git rather than released crates, but it increases the burden on users quite a bit, as they also have to patch their Cargo.toml files. I'd kinda like master to be always-buildable. If we need to shake things out for a longer period before release, there's precedent for dev branches. We can discuss this further on Zulip if we're not quite on the same page.
druid-shell/examples/perftest.rs
Outdated
.new_font_by_name("Consolas", 48.0) | ||
.build() | ||
.unwrap(); | ||
.font_family("Consolas") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be reasonable to just choose MONOSPACE here.
@@ -14,12 +14,12 @@ | |||
|
|||
//! GTK code handling. | |||
|
|||
use gdk::enums::key::*; | |||
use gdk::keys::constants::*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ordinarily I'd ask for the other dependency revs to be in a separate PR from the piet bump, but I'm not going to insist on it; it's reasonable to say that this PR is about rev'ing all deps, whether our own or otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have loved to do this separately, but they were bumped in piet and we won't compile unless we also bump them in druid. 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could bump Druid deps first and then update Piet separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Finnerale the problem there is that druid's deps need to match those in piet, so we can't update it until piet updates.
# We don't depend directly on harfbuzz-sys, it comes through usvg. But we need to pin | ||
# the version, because the latest release of harfbuzz_rs is broken with harfbuzz-sys 0.5. | ||
harfbuzz-sys = {version = "0.4", optional = true } | ||
image = { version = "0.23.4", optional = true } | ||
harfbuzz-sys = { version = "0.5.0", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not consistent with the comment above it. I haven't dug into the issue, but I think we either need to push the pin forward past the breakage, if a fix is released upstream, or continue to pin before it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops this was a mistake, I used the cargo-upgrade
plugin to do the revs, and apparently it doesn't read our very clear comments 😡
rc.draw_text(&text_layout, text_pos, &selection_text_color); | ||
for sel in text_layout.rects_for_range(self.selection.range()) { | ||
let sel = sel + Vec2::new(PADDING_LEFT, top_padding); | ||
let rounded = sel.to_rounded_rect(1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to say, when I saw RoundedRect
removed from the imports, I was hoping to see something like this. Sweet!
piet is not released yet, so this patches to a current git revision. This attempts to make the minimal changes necessary to maintain current functionality.
This is a first cut at bringing druid up to date with recent piet changes.
This doesn't do anything fancy, and uses the piet API directly, instead of having any nice wrapper types.