Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- impl ElementUpdate for Circle {
- fn set_group_transform(&mut self, transform: &Transform) {
- self.transform_data.group_transform = transform.clone();
- }
- fn set_local_transform(&mut self, transform: &Transform) {
- self.transform_data.local_transform = transform.clone();
- }
- fn set_color(&mut self, color: &Color) {
- self.vertex_data.color = color.clone();
- }
- }
- pub fn update_node<T: Element + ElementUpdate>(element: &mut T, attribute_stack: &AttributeStack) {
- element.set_group_transform(&attribute_stack.transform);
- }
- /*
- error[E0277]: the trait bound `&element::circle::Circle: element::ElementUpdate` is not satisfied
- --> src\processor.rs:12:40
- |
- 12 | ElementType::Circle(circle) => update_node(&mut circle, &attribute_stack),
- | ^^^^^^^^^^^ the trait `element::ElementUpdate` is not implemented for `&element::circle::Circle`
- |
- = help: the following implementations were found:
- <element::circle::Circle as element::ElementUpdate>
- note: required by `processor::update_node`
- --> src\processor.rs:26:1
- |
- 26 | pub fn update_node<T: ElementUpdate>(element: &mut T, attribute_stack: &AttributeStack) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- */
Add Comment
Please, Sign In to add comment