Skip to content

(#1012): Do not expose RenderingError::InvalidTransform in the public API

This is only an error that is tracked internally, and never surfaces to the public API: when we run into an invalid transform, we just don't draw the element in question.

So, now we have:

crate::api::RenderingError - public type, without the InvalidTransform variant

crate::error::InternalRenderingError - private type, used everywhere

Same as before, the place where InternalRenderingError::InvalidTransform is caught and is in Node::draw().

In "impl From for RenderingError", I have left a case that actually handles InvalidTransform and converts it to a generic RenderingError::Rendering("invalid transform"). This is supposed to never happen - the error should have been caught in Node::draw() - but I've left it there as a safeguard in case one slips by. Another alternative would be to panic!().

Fixes #1012 (closed)

Merge request reports