修复 稿件背景颜色失效问题
This commit is contained in:
parent
03bb6c6acb
commit
e9e5f68e41
|
|
@ -91,7 +91,7 @@ export const graphOptions = (elId:string, viewMode = false) => {
|
|||
},
|
||||
panning: {
|
||||
// 画布移动
|
||||
enabled: viewMode,
|
||||
enabled: false,
|
||||
pageVisible: false, // 是否分页
|
||||
pageBreak: true,
|
||||
pannable: true,// 是否平移
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ export const graphOptions = (elId:string, viewMode = false) => {
|
|||
},
|
||||
panning: {
|
||||
// 画布移动
|
||||
enabled: viewMode,
|
||||
enabled: false,
|
||||
pageVisible: false, // 是否分页
|
||||
pageBreak: true,
|
||||
pannable: true,// 是否平移
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue