Skip to content

Implement Copy on Fill and Stroke#2475

Merged
hecrj merged 1 commit intoiced-rs:masterfrom
vladh:impl-copy-fill-stroke
Jun 21, 2024
Merged

Implement Copy on Fill and Stroke#2475
hecrj merged 1 commit intoiced-rs:masterfrom
vladh:impl-copy-fill-stroke

Conversation

@vladh
Copy link
Contributor

@vladh vladh commented Jun 21, 2024

In general, would it not be better to have functions such as fill_rectangle take &Fill to prevent unnecessary copies, especially when drawing the same item over and over?

@hecrj hecrj added this to the 0.13 milestone Jun 21, 2024
@hecrj hecrj added feature New feature or request canvas addition labels Jun 21, 2024
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Premature optimization. Compilers are smart and dereferencing could potentially be slower.

In any case, the cost of a copy is negligible when compared to the actual tessellation. So, why bother with these questions?

@hecrj hecrj merged commit 7344a31 into iced-rs:master Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition canvas feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments