| 189 | } |
| 190 | |
| 191 | void Drawable::transform(Mat3F const& transformation) { |
| 192 | Vec2F localTranslation = transformation.transformVec2(Vec2F()); |
| 193 | Mat3F localTransform = Mat3F::translation(-localTranslation) * transformation; |
| 194 | |
| 195 | if (auto line = part.ptr<LinePart>()) |
| 196 | line->line.transform(localTransform); |
| 197 | else if (auto poly = part.ptr<PolyPart>()) |
| 198 | poly->poly.transform(localTransform); |
| 199 | else if (auto image = part.ptr<ImagePart>()) |
| 200 | image->transformation = localTransform * image->transformation; |
| 201 | |
| 202 | position = transformation.transformVec2(position); |
| 203 | } |
| 204 | |
| 205 | void Drawable::rebase(Vec2F const& newBase) { |
| 206 | if (auto line = part.ptr<LinePart>()) |
no test coverage detected