MCPcopy Create free account
hub / github.com/asmuth/clip / plot_axis

Function plot_axis

src/plot/axis.cc:567–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567ReturnCode plot_axis(
568 Context* ctx,
569 PlotConfig* plot,
570 AxisDefinition* config) {
571 const auto& axis = *config;
572 const auto& bbox = plot_get_clip(plot, layer_get(ctx));
573
574 ReturnCode rc;
575 switch (axis.align) {
576 case AxisAlign::X:
577 rc = plot_axis_horizontal(
578 ctx,
579 plot,
580 axis,
581 bbox.y + bbox.h * 0.5,
582 bbox.x,
583 bbox.x + bbox.w);
584 break;
585 case AxisAlign::TOP:
586 rc = plot_axis_horizontal(
587 ctx,
588 plot,
589 axis,
590 bbox.y + bbox.h,
591 bbox.x,
592 bbox.x + bbox.w);
593 break;
594 case AxisAlign::BOTTOM:
595 rc = plot_axis_horizontal(
596 ctx,
597 plot,
598 axis,
599 bbox.y,
600 bbox.x,
601 bbox.x + bbox.w);
602 break;
603 case AxisAlign::Y:
604 rc = plot_axis_vertical(
605 ctx,
606 plot,
607 axis,
608 bbox.x + bbox.w * 0.5,
609 bbox.y,
610 bbox.y + bbox.h);
611 break;
612 case AxisAlign::LEFT:
613 rc = plot_axis_vertical(
614 ctx,
615 plot,
616 axis,
617 bbox.x,
618 bbox.y,
619 bbox.y + bbox.h);
620 break;
621 case AxisAlign::RIGHT:
622 rc = plot_axis_vertical(
623 ctx,
624 plot,

Callers 1

plot_axesFunction · 0.85

Calls 10

plot_get_clipFunction · 0.85
layer_getFunction · 0.85
plot_axis_horizontalFunction · 0.85
plot_axis_verticalFunction · 0.85
layer_get_font_sizeFunction · 0.85
from_ptFunction · 0.85
expr_walk_map_wrappedFunction · 0.85
expr_call_string_fnFunction · 0.85
expr_calln_fnFunction · 0.85
axis_prepareFunction · 0.85

Tested by

no test coverage detected