@@ -14,7 +14,6 @@ import 'package:deriv_chart/src/deriv_chart/chart/helpers/paint_functions/paint_
1414import 'package:deriv_chart/src/deriv_chart/chart/helpers/paint_functions/paint_text.dart' ;
1515import 'package:deriv_chart/src/deriv_chart/chart/y_axis/y_axis_config.dart' ;
1616import 'package:deriv_chart/src/theme/chart_theme.dart' ;
17- import 'package:deriv_chart/src/theme/quill_icons.dart' ;
1817import 'package:deriv_chart/src/theme/painting_styles/marker_style.dart' ;
1918import 'package:flutter/material.dart' ;
2019import 'dart:ui' as ui;
@@ -36,8 +35,7 @@ import 'dart:math' as math;
3635/// - Start markers are shown as location pins with optional labels
3736/// - Entry points are shown as circles with a distinctive border
3837/// - Tick points are shown as small dots
39- /// - Exit points are shown as circles
40- /// - End points are shown as flag icons
38+ /// - Exit and end points are shown as circles
4139///
4240/// This class is part of the chart's visualization pipeline and works in conjunction
4341/// with `MarkerGroupPainter` to render marker groups on the chart canvas.
@@ -133,12 +131,14 @@ class TickMarkerIconPainter extends MarkerGroupIconPainter {
133131 final double markerOpacity =
134132 marker.hasReducedOpacity ? opacity * 0.5 : opacity;
135133
134+ final Offset markerCenter = center + marker.displayOffset;
135+
136136 _drawMarker (
137137 canvas,
138138 size,
139139 theme,
140140 marker,
141- center ,
141+ markerCenter ,
142142 markerGroup.style,
143143 1.2 ,
144144 painterProps.granularity,
@@ -449,9 +449,7 @@ class TickMarkerIconPainter extends MarkerGroupIconPainter {
449449
450450 final double pillHeight = 32 * zoom;
451451 final double radius = pillHeight / 2 ;
452- final double iconSize = 24 * zoom;
453- const double leftPadding = 8 ;
454- const double spacing = 4 ;
452+ const double leftPadding = 16 ;
455453 const double rightPadding = 16 ;
456454
457455 final TextStyle textStyle = theme
@@ -467,8 +465,7 @@ class TickMarkerIconPainter extends MarkerGroupIconPainter {
467465 final String text = markerGroup.profitAndLossText ?? '' ;
468466 final TextPainter textPainter = makeTextPainter (text, textStyle);
469467
470- final double contentWidth =
471- leftPadding + iconSize + spacing + textPainter.width + rightPadding;
468+ final double contentWidth = leftPadding + textPainter.width + rightPadding;
472469
473470 Rect pillRect;
474471 if (fixedLeftAligned) {
@@ -500,27 +497,10 @@ class TickMarkerIconPainter extends MarkerGroupIconPainter {
500497 ..strokeWidth = 1 ;
501498 canvas.drawRRect (rrect, strokePaint);
502499
503- final TextPainter iconPainter = TextPainter (
504- text: TextSpan (
505- text: String .fromCharCode (QuillIcons .flag_checkered.codePoint),
506- style: TextStyle (
507- fontFamily: QuillIcons .kFontFam,
508- fontSize: iconSize,
509- package: QuillIcons .kFontPkg,
510- color: textIconColor.withOpacity (opacity),
511- ),
512- ),
513- textDirection: TextDirection .ltr,
514- )..layout ();
515-
516- final double iconX = pillRect.left + leftPadding;
517- final double iconY = anchor.dy - iconPainter.height / 2 ;
518- iconPainter.paint (canvas, Offset (iconX, iconY));
519-
520500 paintWithTextPainter (
521501 canvas,
522502 painter: textPainter,
523- anchor: Offset (iconX + iconSize + spacing , anchor.dy),
503+ anchor: Offset (pillRect.left + leftPadding , anchor.dy),
524504 anchorAlignment: Alignment .centerLeft,
525505 );
526506
0 commit comments