便签:未选中金底黑字带1px黑边,选中黑底金字带金边
This commit is contained in:
@@ -90,22 +90,30 @@ function makeStickyNote(text, fontSize, selected = false) {
|
|||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
|
|
||||||
if (selected) {
|
if (selected) {
|
||||||
// 先描粗边,再填充盖住内侧一半 → 外露 2px 干净黑边
|
// 选中:黑底金字,外圈 2px 金边(先描边再填充,外露一半)
|
||||||
ctx.strokeStyle = '#14100d';
|
ctx.strokeStyle = '#e0c46a';
|
||||||
ctx.lineWidth = B * 2; // 4px,外露 2px
|
ctx.lineWidth = B * 2;
|
||||||
ctx.lineJoin = 'round';
|
ctx.lineJoin = 'round';
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
ctx.fillStyle = '#14100d';
|
||||||
|
ctx.fill();
|
||||||
|
ctx.fillStyle = '#e0c46a';
|
||||||
} else {
|
} else {
|
||||||
// 非选中:柔和的投影
|
// 非选中:金底黑字 + 1px 黑边(描 2px,填充盖掉内侧 1px)+ 柔和投影
|
||||||
|
ctx.strokeStyle = '#14100d';
|
||||||
|
ctx.lineWidth = 2;
|
||||||
|
ctx.lineJoin = 'round';
|
||||||
|
ctx.stroke();
|
||||||
ctx.shadowColor = 'rgba(0, 0, 0, 0.20)';
|
ctx.shadowColor = 'rgba(0, 0, 0, 0.20)';
|
||||||
ctx.shadowBlur = 5;
|
ctx.shadowBlur = 5;
|
||||||
ctx.shadowOffsetY = 2;
|
ctx.shadowOffsetY = 2;
|
||||||
|
ctx.fillStyle = '#e0c46a';
|
||||||
|
ctx.fill();
|
||||||
|
ctx.shadowColor = 'transparent';
|
||||||
|
ctx.fillStyle = '#14100d';
|
||||||
}
|
}
|
||||||
ctx.fillStyle = '#e0c46a';
|
|
||||||
ctx.fill();
|
|
||||||
|
|
||||||
// 黑色加粗文字
|
// 文字
|
||||||
ctx.fillStyle = '#14100d';
|
|
||||||
ctx.font = font;
|
ctx.font = font;
|
||||||
ctx.textBaseline = 'middle';
|
ctx.textBaseline = 'middle';
|
||||||
ctx.textAlign = 'center';
|
ctx.textAlign = 'center';
|
||||||
|
|||||||
Reference in New Issue
Block a user