mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
feat: support element bgColor desc
This commit is contained in:
parent
748fb0f0f9
commit
1206369874
3 changed files with 7 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ const data = {
|
|||
borderRadius: 20,
|
||||
borderWidth: 2,
|
||||
borderColor: "#bd0b64",
|
||||
bgColor: '#f0f0f0',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -33,6 +34,7 @@ const data = {
|
|||
borderRadius: 60,
|
||||
borderWidth: 10,
|
||||
borderColor: "#bd0b64",
|
||||
bgColor: '#f0f0f0',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -51,6 +53,7 @@ const data = {
|
|||
borderRadius: 20,
|
||||
borderWidth: 2,
|
||||
borderColor: "#bd0b64",
|
||||
bgColor: '#f0f0f0',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
@ -69,6 +72,7 @@ const data = {
|
|||
borderRadius: 20,
|
||||
borderWidth: 2,
|
||||
borderColor: "#bd0b64",
|
||||
bgColor: '#f0f0f0',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
TypeHelperConfig,
|
||||
} from '@idraw/types';
|
||||
import Loader from '../loader';
|
||||
import { clearContext, drawBoxBorder } from './base';
|
||||
import { clearContext, drawBox } from './base';
|
||||
import { rotateElement } from './../transform';
|
||||
|
||||
export function drawText(
|
||||
|
|
@ -15,7 +15,7 @@ export function drawText(
|
|||
helperConfig: TypeHelperConfig
|
||||
) {
|
||||
clearContext(ctx);
|
||||
drawBoxBorder(ctx, elem);
|
||||
drawBox(ctx, elem, elem.desc.bgColor);
|
||||
rotateElement(ctx, elem, () => {
|
||||
|
||||
const desc: TypeElemDescText = {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ type TypeElemDescText = {
|
|||
// fontWeight?: string;
|
||||
fontFamily?: string;
|
||||
textAlign?: 'center' | 'left' | 'right';
|
||||
bgColor: string;
|
||||
} & TypeElemBoxDesc
|
||||
|
||||
// type TypeElemDescCircle = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue