@@ -22,7 +22,7 @@ Chart::Chart() :
2222 nextOptions = std::make_shared<Gen::Options>();
2323
2424 animator->onDraw .attach (
25- [&](const Gen::PlotPtr& actPlot)
25+ [&](const Gen::PlotPtr & actPlot)
2626 {
2727 this ->actPlot = actPlot;
2828 if (onChanged) onChanged ();
@@ -56,9 +56,9 @@ void Chart::setBoundRect(const Geom::Rect &rect, Gfx::ICanvas &info)
5656 }
5757}
5858
59- void Chart::animate (const OnComplete& onComplete)
59+ void Chart::animate (const OnComplete & onComplete)
6060{
61- auto f = [=, this ](const Gen::PlotPtr& plot, bool ok)
61+ auto f = [=, this ](const Gen::PlotPtr & plot, bool ok)
6262 {
6363 actPlot = plot;
6464 if (ok) {
@@ -105,9 +105,11 @@ void Chart::draw(Gfx::ICanvas &canvas) const
105105 if (actPlot
106106 && (!events.draw .begin
107107 || events.draw .begin ->invoke (
108- Util::EventDispatcher::Params{})))
109- {
110- Draw::DrawingContext context (canvas, layout, events.draw , *actPlot);
108+ Util::EventDispatcher::Params{}))) {
109+ Draw::DrawingContext context (canvas,
110+ layout,
111+ events.draw ,
112+ *actPlot);
111113
112114 Draw::DrawBackground (
113115 layout.boundary .outline (Geom::Size::Square (1 )),
@@ -147,7 +149,7 @@ void Chart::draw(Gfx::ICanvas &canvas) const
147149
148150 if (events.draw .logo ->invoke ()) {
149151 auto filter = *(actPlot ? actPlot->getStyle ()
150- : stylesheet.getDefaultParams ())
152+ : stylesheet.getDefaultParams ())
151153 .logo .filter ;
152154
153155 auto logoRect = getLogoBoundary ();
@@ -164,8 +166,8 @@ void Chart::draw(Gfx::ICanvas &canvas) const
164166Geom::Rect Chart::getLogoBoundary () const
165167{
166168 const auto &logoStyle = (actPlot ? actPlot->getStyle ()
167- : stylesheet.getDefaultParams ())
168- .logo ;
169+ : stylesheet.getDefaultParams ())
170+ .logo ;
169171
170172 auto logoWidth =
171173 logoStyle.width ->get (layout.boundary .size .minSize (),
@@ -178,12 +180,12 @@ Geom::Rect Chart::getLogoBoundary() const
178180 Styles::Sheet::baseFontSize (layout.boundary .size , false ));
179181
180182 return {layout.boundary .topRight ()
181- - Geom::Point (logoPad.right + logoWidth,
182- logoPad.bottom + logoHeight),
183+ - Geom::Point (logoPad.right + logoWidth,
184+ logoPad.bottom + logoHeight),
183185 Geom::Size (logoWidth, logoHeight)};
184186}
185187
186- Gen::PlotPtr Chart::plot (const Gen::PlotOptionsPtr& options)
188+ Gen::PlotPtr Chart::plot (const Gen::PlotOptionsPtr & options)
187189{
188190 computedStyles =
189191 stylesheet.getFullParams (options, layout.boundary .size );
@@ -202,12 +204,13 @@ Draw::CoordinateSystem Chart::getCoordSystem() const
202204
203205 return {plotArea,
204206 options.angle ,
205- options.polar ,
207+ options.coordSystem ,
206208 actPlot->keepAspectRatio };
207209 }
208210 return {plotArea,
209211 0.0 ,
210- Math::FuzzyBool (),
212+ ::Anim::Interpolated<Gen::CoordSystem>{
213+ Gen::CoordSystem::cartesian},
211214 Math::FuzzyBool ()};
212215}
213216
@@ -219,19 +222,19 @@ Gen::Marker *Chart::markerAt(const Geom::Point &point) const
219222
220223 const Draw::CoordinateSystem coordSys (plotArea,
221224 options.angle ,
222- options.polar ,
225+ options.coordSystem ,
223226 actPlot->keepAspectRatio );
224227
225228 auto originalPos = coordSys.getOriginal (point);
226229
227230 for (auto &marker : actPlot->getMarkers ()) {
228- auto drawItem = Draw::AbstractMarker::createInterpolated (
229- marker,
230- options,
231- actPlot->getStyle (),
232- coordSys,
233- actPlot->getMarkers (),
234- 0 );
231+ auto drawItem =
232+ Draw::AbstractMarker::createInterpolated ( marker,
233+ options,
234+ actPlot->getStyle (),
235+ coordSys,
236+ actPlot->getMarkers (),
237+ 0 );
235238
236239 if (drawItem.bounds (originalPos)) return ▮
237240 }
0 commit comments