Skip to content

Conversation

@linghaoSu
Copy link

Why

when enabling dirty rect, and then clicking the button in the toolbox, the zrender consider where should to repainted, but does not consider text when they are hosted in another element, so, maybe we should consider ignore textElment when they hosted in other element and the host element that is ignored.

Before

image

After

image

}

// consider host target
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can treat __hostTarget as a special parent and doing both check in the

let parent = this.parent;

if (considerAncestors) {
      let node = this;
      while (node) {
          if (node.ignore) {
              return false;
          }
          node = node.parent || node.__hostTarget;
      }
  }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I agree with this way, we don't need to modify the api of shouldBePainted, I have fixed this using these codes. Please review again.

@linghaoSu linghaoSu requested a review from pissang February 28, 2022 14:25
@linghaoSu
Copy link
Author

hi, @pissang Is there anything else wrong with this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useDirtyRect = true and saving image shows "Save as Image" label

2 participants