-
Notifications
You must be signed in to change notification settings - Fork 157
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
shadowColor method missing #72
Comments
I have tried to add support for a drop-shadow filter ( https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter ) : ctx.prototype.__applyFilter = function () {
var filter = this.filter;
if (filter != null) {
var match = /^drop-shadow\(([^p]+)px\s+([^p]+)px\s+([^p]+)px\s+([\s\S]+?)\)$/.exec(filter);
if (match != null) {
var dx = match[1];
var dy = match[2];
var stdDeviation = Number.parseFloat(match[3]) / 2;
var floodColor = match[4];
var feDropShadowElement = this.__createElement("feDropShadow", {
dx: dx,
dy: dy,
stdDeviation: stdDeviation,
"flood-color": floodColor
}, false);
var id = randomString(this.__ids);
var filterElement = this.__createElement("filter", {
id: id
}, false);
filterElement.appendChild(feDropShadowElement);
this.__defs.appendChild(filterElement);
this.__currentElement.setAttribute('filter', format("url(#{id})", {id:id}));
}
}
}; |
Nice, DM me on Discord Zamiel#8743 |
@Zamiell i don't know how to use Discord, do you want to ask something? |
Was gonna offer to pay you |
@Zamiell , thanks, glad to see this, but no need I have some money |
23 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like ctx.shadowColor isn't implemented in the latest version of the library. If anyone wants to add this, I'll pay a bounty.
The text was updated successfully, but these errors were encountered: