Commit f415c29e authored by Paul Asmuth's avatar Paul Asmuth
Browse files

legend padding...

parent 0316a73c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -392,7 +392,9 @@ void Canvas::renderOutsideLegends(
        legend.get(),
        kLegendOutsideHorizPadding,
        false);
    viewport->setPaddingTop(viewport->paddingTop() + kLegendOutsideVertPadding);

    viewport->setPaddingBottom(viewport->paddingBottom() + kLegendOutsideVertPadding);
    renderRightLegend(
        target,
        viewport,
@@ -412,6 +414,8 @@ void Canvas::renderInsideLegends(
  for (const auto& legend : legends_) {
    target->beginGroup("legend");
    viewport->setPaddingTop(viewport->paddingTop() + kLegendInsideVertPadding);
    viewport->setPaddingBottom(
        viewport->paddingBottom() + kLegendInsideVertPadding);

    renderLeftLegend(
        target,
@@ -427,7 +431,6 @@ void Canvas::renderInsideLegends(
        kLegendInsideHorizPadding,
        false);

    viewport->setPaddingTop(viewport->paddingTop() + kLegendInsideVertPadding);
    target->finishGroup();
  }

@@ -513,8 +516,7 @@ void Canvas::renderLeftLegend(

  double height;
  if (bottom) {
    height = viewport->paddingTop() + viewport->innerHeight() -
      kLegendLineHeight;
    height = viewport->paddingTop() + viewport->innerHeight() - 5.0f;
  } else {
    height = viewport->paddingTop();
  }
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ public:
  static const int kLegendLineHeight = 20.0f; // FIXPAUL make configurable
  static const int kLegendInsideVertPadding = 10.0f;
  static const int kLegendInsideHorizPadding = 15.0f;
  static const int kLegendOutsideVertPadding = 5.0f;
  static const int kLegendOutsideHorizPadding = 25.0f;
  static const int kLegendPointY = 6;
  static const int kLegendPointWidth = 8;