You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/06/22 04:39:01 UTC

[GitHub] [incubator-echarts] plainheart commented on a change in pull request #12834: fix: #12812

plainheart commented on a change in pull request #12834:
URL: https://github.com/apache/incubator-echarts/pull/12834#discussion_r443313348



##########
File path: src/echarts.js
##########
@@ -1142,8 +1143,26 @@ echartsProto.resize = function (opts) {
     flushPendingActions.call(this, silent);
 
     triggerUpdatedEvent.call(this, silent);
+
+    moveTooltip.call(this);

Review comment:
       Still not sure whether it is proper to handle tooltip relocation here, maybe it's better to move these logic to `TooltipView`?

##########
File path: src/echarts.js
##########
@@ -1142,8 +1143,26 @@ echartsProto.resize = function (opts) {
     flushPendingActions.call(this, silent);
 
     triggerUpdatedEvent.call(this, silent);
+
+    moveTooltip.call(this);
 };
 
+/**
+ * when alwaysShowContent is true change or rotation window size and restore will move tooltip
+ * @private
+ */
+function moveTooltip() {
+    var tooltips = filter(this._componentsViews, function (item) {
+        return item.__model.mainType === 'tooltip';
+    });
+    each(tooltips, function (tooltip) {
+        var realLeft = tooltip._tooltipContent._styleCoord[2] * this._zr.getWidth();
+        var realRight = tooltip._tooltipContent._styleCoord[1];
+        var ratio = tooltip._tooltipContent._styleCoord[2];
+        tooltip._tooltipContent.moveTo(realLeft, realRight, ratio);

Review comment:
       I can't find the usage of the parameter `ratio`, did I miss something?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org