修复 稿件背景颜色失效问题

This commit is contained in:
YuanFeng 2024-10-24 22:40:12 +08:00
parent 03bb6c6acb
commit e9e5f68e41
4 changed files with 40 additions and 34 deletions

View File

@ -91,7 +91,7 @@ export const graphOptions = (elId:string, viewMode = false) => {
},
panning: {
// 画布移动
enabled: viewMode,
enabled: false,
pageVisible: false, // 是否分页
pageBreak: true,
pannable: true,// 是否平移

View File

@ -481,21 +481,21 @@ const init = (isDesignMode: boolean, bgConfig: any, data = {}, propDataInfo = {}
height: maxSize,
}
graph = new Graph(options)
//
graph.use(
new Scroller({
enabled: true,
pageVisible: true, //
pageBreak: false,
pannable: true,//
// pageWidth: that.pageConfig.editArea.width * 10,
// pageHeight: that.pageConfig.editArea.height * 10,
// modifiers: ['ctrl', 'meta'],
}),
)
if (that.editState) {
//
graph.use(
new Scroller({
enabled: true,
pageVisible: true, //
pageBreak: false,
pannable: true,//
// pageWidth: that.pageConfig.editArea.width * 10,
// pageHeight: that.pageConfig.editArea.height * 10,
// modifiers: ['ctrl', 'meta'],
}),
)
// 线
graph.use(
@ -974,9 +974,9 @@ const getDeviceDPI = () => {
}
let rulerContainer = document.createElement('div');
const addDrawRuler = () => {
if(!that.editState){
return;
}
// if(!that.editState){
// return;
// }
//
const dpi = getDeviceDPI();
const mmPerInch = 25.4; // 1 = 25.4
@ -1004,7 +1004,10 @@ const addDrawRuler = () => {
backgroundCanvas.style.left = '0px'; //
backgroundCanvas.style.zIndex = '-1'; //
backgroundCanvas.style.backgroundColor = that.pageConfig.background.areaColor
backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`;
if(that.editState) {
backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`;
}
backgroundCanvas.style.pointerEvents = 'none';
rulerContainer.appendChild(backgroundCanvas);
if (that.editState) {

View File

@ -91,7 +91,7 @@ export const graphOptions = (elId:string, viewMode = false) => {
},
panning: {
// 画布移动
enabled: viewMode,
enabled: false,
pageVisible: false, // 是否分页
pageBreak: true,
pannable: true,// 是否平移

View File

@ -481,21 +481,21 @@ const init = (isDesignMode: boolean, bgConfig: any, data = {}, propDataInfo = {}
height: maxSize,
}
graph = new Graph(options)
//
graph.use(
new Scroller({
enabled: true,
pageVisible: true, //
pageBreak: false,
pannable: true,//
// pageWidth: that.pageConfig.editArea.width * 10,
// pageHeight: that.pageConfig.editArea.height * 10,
// modifiers: ['ctrl', 'meta'],
}),
)
if (that.editState) {
//
graph.use(
new Scroller({
enabled: true,
pageVisible: true, //
pageBreak: false,
pannable: true,//
// pageWidth: that.pageConfig.editArea.width * 10,
// pageHeight: that.pageConfig.editArea.height * 10,
// modifiers: ['ctrl', 'meta'],
}),
)
// 线
graph.use(
@ -974,9 +974,9 @@ const getDeviceDPI = () => {
}
let rulerContainer = document.createElement('div');
const addDrawRuler = () => {
if(!that.editState){
return;
}
// if(!that.editState){
// return;
// }
//
const dpi = getDeviceDPI();
const mmPerInch = 25.4; // 1 = 25.4
@ -1004,7 +1004,10 @@ const addDrawRuler = () => {
backgroundCanvas.style.left = '0px'; //
backgroundCanvas.style.zIndex = '-1'; //
backgroundCanvas.style.backgroundColor = that.pageConfig.background.areaColor
backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`;
if(that.editState) {
backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`;
}
backgroundCanvas.style.pointerEvents = 'none';
rulerContainer.appendChild(backgroundCanvas);
if (that.editState) {