Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forceUpdate flag to view.update() #1913

Open
petbuc16 opened this issue Mar 30, 2021 · 1 comment
Open

Add forceUpdate flag to view.update() #1913

petbuc16 opened this issue Mar 30, 2021 · 1 comment
Labels
cat: canvas-rendering status: PR proposed an active pull request should fix this issue type: improvement

Comments

@petbuc16
Copy link

petbuc16 commented Mar 30, 2021

When I am loading a font in the background and add it to the dom afterwards, the paper view does not recognize the change.

The function update says:

update: function() {
  if (!this._needsUpdate)
	  return false; 

  var project = this._project,
	  ctx = this._context,
	  size = this._viewSize;

  ctx.clearRect(0, 0, size.width + 1, size.height + 1);

  if (project)
	  project.draw(ctx, this._matrix, this._pixelRatio);

  this._needsUpdate = false;
  return true;
}

So add a flag forceUpdate to the function.

@sapics
Copy link
Member

sapics commented Apr 1, 2021

I agree that forceUpdate is necessary for updating after font loading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: canvas-rendering status: PR proposed an active pull request should fix this issue type: improvement
Projects
None yet
Development

No branches or pull requests

2 participants