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

Apply clip area on the labels/captions considering the padding #135

Open
stockiNail opened this issue Sep 29, 2022 · 4 comments
Open

Apply clip area on the labels/captions considering the padding #135

stockiNail opened this issue Sep 29, 2022 · 4 comments
Labels
breaking change A change which needs a major version because not compatible with previous versions enhancement New feature or request
Milestone

Comments

@stockiNail
Copy link
Collaborator

Currently before drawing a caption or a label, the area of the element will be clipped.

But the full element size is clipped, instead it should clip an area considering the padding set in the configuration.

function drawText(ctx, rect, item, levels) {
const opts = rect.options;
const captions = opts.captions;
ctx.save();
ctx.beginPath();
ctx.rect(rect.x, rect.y, rect.width, rect.height);
ctx.clip();

This is a breaking change because it could change how the labels or captions will be cut.

@stockiNail stockiNail added enhancement New feature or request breaking change A change which needs a major version because not compatible with previous versions labels Sep 29, 2022
@stockiNail stockiNail added this to the 3.0.0 milestone Sep 29, 2022
@kurkle
Copy link
Owner

kurkle commented Sep 29, 2022

This one could be considered a bug instead of breaking change. That said, I think it's ok to delay until v3 and then the breaking change label is fine.

@stockiNail
Copy link
Collaborator Author

Yes it could be. Sorry if I have seen only this morning. Anyway no issue till now!

@stockiNail
Copy link
Collaborator Author

@kurkle I meant that till now the current logic (without considering the padding) seems to be good for the users. This is the reason why I didn't tag as bug.

@stockiNail
Copy link
Collaborator Author

@kurkle anyway if you want I can do it as bug fixing. I have already started but I stopped me because it sounded a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change A change which needs a major version because not compatible with previous versions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants