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

fixes and a possible canvas addition #218

Merged
merged 12 commits into from Jul 22, 2019
Merged

fixes and a possible canvas addition #218

merged 12 commits into from Jul 22, 2019

Conversation

@s3bk
Copy link
Contributor

s3bk commented Jul 16, 2019

What I am not sure about is fill_layout (see #202). I added it because it was needed to push layouts directly, but currently I am working on removing the dependency on text altogether. (And instead push the glyph outlines).

swf/src/shapes.rs Outdated Show resolved Hide resolved
@pcwalton
Copy link
Collaborator

pcwalton commented Jul 19, 2019

fill_layout is perfectly fine. I was thinking of adding it myself actually.

Sebastian Köln
@@ -94,12 +94,12 @@ impl Shape {

#[inline]
fn first(&self) -> LineSegment {
self.outline.first().unwrap()
*self.outline.first().unwrap()

This comment has been minimized.

@pcwalton

pcwalton Jul 22, 2019

Collaborator

Will this still compile?

This comment has been minimized.

@s3bk

s3bk Jul 22, 2019

Author Contributor

It compiles for me (cargo build -p pathfinder_swf)

This comment has been minimized.

@s3bk

s3bk Jul 22, 2019

Author Contributor

without:

error[E0308]: mismatched types
   --> swf/src/shapes.rs:102:9
    |
101 |     fn last(&self) -> LineSegment {
    |                       ----------- expected `shapes::LineSegment` because of return type
102 |         self.outline.last().unwrap()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |         |
    |         expected struct `shapes::LineSegment`, found reference
    |         help: consider dereferencing the borrow: `*self.outline.last().unwrap()`
    |
    = note: expected type `shapes::LineSegment`
               found type `&shapes::LineSegment`
@pcwalton
Copy link
Collaborator

pcwalton commented Jul 22, 2019

Hmm, we shouldn't return a reference from Outline::last() then, but let's fix that in a follow up.

@pcwalton pcwalton merged commit 842348c into servo:master Jul 22, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@s3bk
Copy link
Contributor Author

s3bk commented Jul 22, 2019

    pub(crate) outline: Vec<LineSegment>, // Could be Vec<(start, end)>

not much that can be done here …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.