@@ -75,11 +75,18 @@ Marker::Marker(const Options &options,
7575 index,
7676 horizontal ? &mainId->value : subAxisId);
7777
78- spacing.x = (horizontal || (lineOrCircle && !polar))
79- && options.getChannels ().anyAxisSet ()
80- && channels.at (ChannelId::x).isDimension ()
81- ? 1
82- : 0 ;
78+ auto yChannelRectDim =
79+ channels.at (ChannelId::y).isDimension ()
80+ && channels.at (ChannelId::y).hasDimension ()
81+ && options.geometry == ShapeType::rectangle
82+ && options.align != Base::Align::Type::stretch;
83+
84+ spacing.x =
85+ (horizontal || (lineOrCircle && !polar) || yChannelRectDim)
86+ && options.getChannels ().anyAxisSet ()
87+ && channels.at (ChannelId::x).isDimension ()
88+ ? 1
89+ : 0 ;
8390
8491 position.y = size.y = getValueForChannel (channels,
8592 ChannelId::y,
@@ -88,7 +95,13 @@ Marker::Marker(const Options &options,
8895 index,
8996 !horizontal ? &mainId->value : subAxisId);
9097
91- spacing.y = (!horizontal || lineOrCircle)
98+ auto xChannelRectDim =
99+ channels.at (ChannelId::x).isDimension ()
100+ && channels.at (ChannelId::x).hasDimension ()
101+ && options.geometry == ShapeType::rectangle
102+ && options.align != Base::Align::Type::stretch;
103+
104+ spacing.y = (!horizontal || lineOrCircle || xChannelRectDim)
92105 && options.getChannels ().anyAxisSet ()
93106 && channels.at (ChannelId::y).isDimension ()
94107 ? 1
@@ -223,4 +236,4 @@ bool Marker::Label::operator==(const Label &other) const
223236{
224237 return value == other.value && indexStr == other.indexStr ;
225238}
226- }
239+ }
0 commit comments