mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
feat: @idraw/core selected area add style
This commit is contained in:
parent
50191464b7
commit
15744ddf35
2 changed files with 6 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ export function clearContext(ctx: TypeContext) {
|
|||
ctx.setFillStyle('rgb(0 0 0 / 0%)');
|
||||
ctx.setStrokeStyle('rgb(0 0 0 / 0%)');
|
||||
ctx.setLineDash([]);
|
||||
ctx.setGlobalAlpha(1);
|
||||
}
|
||||
|
||||
export function drawBgColor(ctx: TypeContext, color: string) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,11 @@ export function drawAreaWrapper(ctx: TypeContext, config: TypeHelperConfig) {
|
|||
const wrapper = config.selectedAreaWrapper;
|
||||
if (wrapper && wrapper.w > 0 && wrapper.h > 0) {
|
||||
clearContext(ctx);
|
||||
// draw wrapper's box
|
||||
ctx.setGlobalAlpha(0.3);
|
||||
ctx.setFillStyle(wrapper.color);
|
||||
ctx.fillRect(wrapper.x, wrapper.y, wrapper.w, wrapper.h);
|
||||
|
||||
clearContext(ctx);
|
||||
ctx.beginPath();
|
||||
ctx.setLineDash([]);
|
||||
ctx.setLineWidth(wrapper.lineWidth);
|
||||
|
|
|
|||
Loading…
Reference in a new issue