! * \brief WorksheetElementPrivate::mapParentToPlotArea * Mapping a point from parent coordinates to plotArea coordinates * Needed because in some cases the parent is not the PlotArea, but a child of it (Marker/InfoElement) * IMPORTANT: function is also used in Custompoint, so when changing anything, change it also there * \param point point in parent coordinates * \return point in PlotArea
| 1060 | * \return point in PlotArea coordinates |
| 1061 | */ |
| 1062 | QPointF WorksheetElementPrivate::mapParentToPlotArea(QPointF point) const { |
| 1063 | auto* parent = q->parent(AspectType::CartesianPlot); |
| 1064 | if (parent) { |
| 1065 | auto* plot = static_cast<CartesianPlot*>(parent); |
| 1066 | // mapping from parent to item coordinates and them to plot area |
| 1067 | return mapToItem(plot->plotArea()->graphicsItem(), mapFromParent(point)); |
| 1068 | } |
| 1069 | |
| 1070 | return point; // don't map if no parent set. Then it's during load |
| 1071 | } |
| 1072 | |
| 1073 | /*! |
| 1074 | * \brief WorksheetElementPrivate::mapPlotAreaToParent |
nothing calls this directly
no test coverage detected