message: Make text positioning more understandable
diff: @@ -23,6 +23,10 @@ import {
  import { IUpdatablePaneView, UpdateType } from './iupdatable-pane-view';
  +const enum Constants {
  + textMargin = 0.1,
  +}
  +
  interface Offsets {
  aboveBar: number;
  belowBar: number;
  @@ -52,15 +56,15 @@ function fillSizeAndY(
  case 'inBar': {
  rendererItem.y = priceScale.priceToCoordinate(inBarPrice, firstValue);
  if (rendererItem.text !== undefined) {
  - rendererItem.text.y = rendererItem.y + halfSize + shapeMargin / 2 + textHeight * 0.6 as Coordinate;
  + rendererItem.text.y = rendererItem.y + halfSize + shapeMargin + textHeight * (0.5 + Constants.textMargin) as Coordinate;
  }
  return;
  }
  case 'aboveBar': {
  rendererItem.y = (priceScale.priceToCoordinate(highPrice, firstValue) - halfSize - offsets.aboveBar) as Coordinate;
  if (rendererItem.text !== undefined) {
  - rendererItem.text.y = rendererItem.y - halfSize - textHeight * 0.6 as Coordinate;
  - offsets.aboveBar += textHeight * 1.2;
  + rendererItem.text.y = rendererItem.y - halfSize - textHeight * (0.5 + Constants.textMargin) as Coordinate;
  + offsets.aboveBar += textHeight * (1 + 2 * Constants.textMargin);
  }
  offsets.aboveBar += shapeSize + shapeMargin;
  return;
  @@ -68,8 +72,8 @@ function fillSizeAndY(
  case 'belowBar': {
  rendererItem.y = (priceScale.priceToCoordinate(lowPrice, firstValue) + halfSize + offsets.belowBar) as Coordinate;
  if (rendererItem.text !== undefined) {
  - rendererItem.text.y = rendererItem.y + halfSize + shapeMargin + textHeight * 0.6 as Coordinate;
  - offsets.belowBar += textHeight * 1.2;
  + rendererItem.text.y = rendererItem.y + halfSize + shapeMargin + textHeight * (0.5 + Constants.textMargin) as Coordinate;
  + offsets.belowBar += textHeight * (1 + 2 * Constants.textMargin);
  }
  offsets.belowBar += shapeSize + shapeMargin;
  return;
  