private static double CalculateOffsetY(double offsetY, int textHeight) { if (double.IsNaN(offsetY)) // first time offsetY = textHeight*0.5 + BoxMargin; else offsetY += textHeight; // todo: get size from text (or just pass stack nr) return offsetY; }