Skip to content

Commit 527ff8d

Browse files
emilyklarchmoj
andauthored
change Object.assign to Lib.extendFlat
Co-authored-by: Mojtaba Samimi <33888540+archmoj@users.noreply.github.com>
1 parent 2aa2b8f commit 527ff8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/titles/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@ function draw(gd, titleClass, options) {
239239
var titleElMathGroup = group.select('.' + titleClass + '-math-group');
240240
var titleElMathHeight = titleElMathGroup.node() ? titleElMathGroup.node().getBBox().height : 0;
241241
var subtitleShift = titleElMathHeight ? titleElMathHeight + MATHJAX_PADDING_BOTTOM : titleElHeight;
242-
var subtitleAttributes = Object.assign({}, attributes);
243-
subtitleAttributes.y += subtitleShift;
242+
var subtitleAttributes = Lib.extendFlat({}, attributes, {
243+
y: subtitleShift + attributes.y
244+
});
244245

245246
subtitleEl.attr('transform', transformVal);
246247
subtitleEl.style('opacity', subtitleOpacity * Color.opacity(subFontColor))

0 commit comments

Comments
 (0)