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

Tiling pattern #25

Merged
merged 12 commits into from
Oct 28, 2024
Merged

Tiling pattern #25

merged 12 commits into from
Oct 28, 2024

Conversation

yutannihilation
Copy link
Owner

No description provided.

@yutannihilation
Copy link
Owner Author

It turned out the implementation #23 was wrong. Paul Murrel's blog post says:

If the device implements patterns, it must return a pattern reference (as an R object) as the return value from this function. This reference is passed back to the device via R_GE_gcontent.patternFill.

but #23 doesn't implement this. This was the reason of #24 (because it always uses the pattern fill)

@yutannihilation
Copy link
Owner Author

Why doesn't this work...?

library(grid)

pat <- pattern(
  circleGrob(
    r = unit(0.1, "npc"),
    gp = gpar(col = NA, fill = "grey")
  ),
  width = unit(0.2, "npc"),
  height = unit(0.2, "npc"),
  extend = "repeat"
)
pushViewport(viewport(gp = gpar(fill = pat)))
grid.rect(width = .5, x = 0.1)

image

@yutannihilation
Copy link
Owner Author

It seems the reason is just that I don't understand how to use Image for brush. Let's merge this for now.

linebender/vello#724

@yutannihilation yutannihilation merged commit 5e6d04f into main Oct 28, 2024
7 checks passed
@yutannihilation yutannihilation deleted the pattern2 branch October 28, 2024 04:50
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

Successfully merging this pull request may close these issues.

1 participant