src/ui/canvas.cpp

changeset 115
ed884a2fb009
parent 113
c0d064521ee0
child 118
8e1c9f18ae15
equal deleted inserted replaced
114:4e03b0e2a29f 115:ed884a2fb009
211 {"-𝑧", {0, 0, -1}}, 211 {"-𝑧", {0, 0, -1}},
212 }; 212 };
213 for (const auto& axis : directions) 213 for (const auto& axis : directions)
214 { 214 {
215 const QPointF x_p = this->modelToScreenCoordinates(axis.direction); 215 const QPointF x_p = this->modelToScreenCoordinates(axis.direction);
216 const auto intersection = geom::rayRectangleIntersection(geom::rayFromPoints(toVec2(p1), toVec2(x_p)), box); 216 const auto intersection = geom::rayRectangleIntersection(
217 geom::rayFromPoints(toVec2(p1), toVec2(x_p)),
218 box);
217 if (intersection.has_value()) 219 if (intersection.has_value())
218 { 220 {
219 renderText(axis.text, *intersection); 221 renderText(axis.text, *intersection);
220 } 222 }
221 } 223 }

mercurial