fix color index mismatch
This commit is contained in:
parent
bea706bf68
commit
bd160df487
2 changed files with 10 additions and 10 deletions
|
|
@ -195,7 +195,9 @@
|
|||
MODES,
|
||||
VIEWS,
|
||||
SETUP,
|
||||
SECURE
|
||||
SECURE,
|
||||
STACKS,
|
||||
SPACE
|
||||
},
|
||||
var: {
|
||||
layer_lo: 0,
|
||||
|
|
@ -272,7 +274,7 @@
|
|||
reload: reload,
|
||||
restore: restoreWorkspace,
|
||||
clear: clearWorkspace,
|
||||
save: saveWorkspace,
|
||||
save: saveWorkspace
|
||||
},
|
||||
tweak,
|
||||
util: {
|
||||
|
|
|
|||
|
|
@ -178,15 +178,13 @@
|
|||
// allow changing colors
|
||||
if (opts.color) {
|
||||
if (!cur.cpath) {
|
||||
// seed
|
||||
cur.cpath = [ Object.assign({ start: 0, count: indln - 1 }, cur.color) ];
|
||||
} else {
|
||||
// rewrite last color count if color or opacity have changed
|
||||
const pc = cur.cpath[cur.cpath.length - 1];
|
||||
if (pc.face !== opts.color.face || pc.opacity !== opts.color.opacity) {
|
||||
pc.count = indln - 1;
|
||||
cur.cpath.push(Object.assign({ start: indln, count: Infinity }, opts.color));
|
||||
}
|
||||
}
|
||||
// rewrite last color count if color or opacity have changed
|
||||
const pc = cur.cpath[cur.cpath.length - 1];
|
||||
if (pc.face !== opts.color.face || pc.opacity !== opts.color.opacity) {
|
||||
pc.count = indln - 1;
|
||||
cur.cpath.push(Object.assign({ start: indln, count: Infinity }, opts.color));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue