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

Piet 0.2 #1143

Merged
merged 3 commits into from
Aug 21, 2020
Merged

Piet 0.2 #1143

merged 3 commits into from
Aug 21, 2020

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Aug 19, 2020

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.

@cmyr cmyr force-pushed the piet-0.2 branch 4 times, most recently from 50c0743 to 7c6759b Compare August 21, 2020 14:15
@cmyr cmyr marked this pull request as ready for review August 21, 2020 14:28
@cmyr cmyr added the breaking change pull request breaks user code label Aug 21, 2020
Copy link
Contributor

@raphlinus raphlinus left a 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]
Copy link
Contributor

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.

.new_font_by_name("Consolas", 48.0)
.build()
.unwrap();
.font_family("Consolas")
Copy link
Contributor

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::*;
Copy link
Contributor

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.

Copy link
Member Author

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. 😢

Copy link
Collaborator

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?

Copy link
Member Author

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 }
Copy link
Contributor

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.

Copy link
Member Author

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);
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change pull request breaks user code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants