我想在单击粗画笔按钮时删除线宽,但它不起作用,根据您单击的按钮,此绘制条件中有不同的条件,我正在删除擦除画布中的模糊和阴影颜色,但它不起作用。我正在根据按钮更改绘图设计。我正在根据按钮更改绘图设计
var spray = false;
var glowwrite = false;
var eraseCnavas = false;
var newLineWidth;
var newColor = 'black';
thickbrush.addEventListener('click', function () {
spray = true;
eraseCnavas = false;
glowwrite = false;
});
glow.addEventListener('click', function () {
spray = false;
eraseCnavas = false;
glowwrite = true;
erase.classList.remove('glowbrush');
})
erase.addEventListener('click', function () {
eraseCnavas = true;
spray = false;
eraseCnavas = false;
brushname.innerHTML = 'Eraser';
})
var clientX, clientY, timeout;
function draw(e) {
if (painting) {
previous = {
x: mouse.x,
y: mouse.y
};
mouse = oMousePos(canvas, e);
// saving the points in the points array
points.push({
x: mouse.x,
y: mouse.y,
color: newColor,
lineWidth: newLineWidth
})
console.log('pushing to pints length = ' + points.length);
if (eraseCnavas) {
c.strokeStyle = '#ffffff';
c.shadowBlur = 0;
c.shadowColor = none;
}
if (glowwrite) {
c.shadowBlur = 10;
c.shadowColor = 'rgb(0, 0, 0)';
}
if (spray) {
c.lineCap = 'round';
newColor = 'none';
newLineWidth= 0;
timeout = setTimeout(spraying, 50);
}
我想当你点击喷雾按钮时,应该被移除,只有喷雾会显示,当你点击擦除时,它应该从线条本身移除阴影颜色和阴影模糊我正在移除但它不起作用
RISEBY
相关分类