|
@@ -10,14 +10,18 @@ import Settings from "@/graphic/Settings.js";
|
|
|
import SVGIcons from "../CanvasStyle/ImageLabels/SVGIcons";
|
|
|
import VectorStyle from "@/graphic/enum/VectorStyle.js";
|
|
|
import VectorWeight from "@/graphic/enum/VectorWeight.js";
|
|
|
+import router from "@/router/index";
|
|
|
+
|
|
|
+const isScreenStyle = () =>
|
|
|
+ Settings.screenMode && router.currentRoute.value.params.mode === "0";
|
|
|
|
|
|
const imgCache = {};
|
|
|
export const help = {
|
|
|
getVectorStyle(vector, geoType = vector.geoType) {
|
|
|
const geoId = vector?.vectorId;
|
|
|
- if (!geoId || Settings.screenMode) {
|
|
|
+ if (!geoId || isScreenStyle()) {
|
|
|
return [
|
|
|
- Settings.screenMode && Style["Screen"][geoType]
|
|
|
+ isScreenStyle() && Style["Screen"][geoType]
|
|
|
? Style["Screen"][geoType]
|
|
|
: Style[geoType],
|
|
|
undefined,
|
|
@@ -201,7 +205,7 @@ export const help = {
|
|
|
ctx.font = `${fontSize}px Microsoft YaHei`;
|
|
|
const textCenter = help.getTextCenter(ctx, text);
|
|
|
ctx.fillStyle = style.backColor;
|
|
|
- if (!Settings.screenMode) {
|
|
|
+ if (!isScreenStyle()) {
|
|
|
// const padding = style.padding;
|
|
|
// help.roundRect(
|
|
|
// ctx,
|
|
@@ -594,7 +598,7 @@ export default class Draw {
|
|
|
const [style] = help.setVectorStyle(this.context, vector, ["NormalLine"]);
|
|
|
help.drawStyleLine(this.context, [start, end]);
|
|
|
help.drawLineText(this.context, start, end, width, {
|
|
|
- fillColor: Settings.screenMode ? "#000" : "#fff",
|
|
|
+ fillColor: isScreenStyle() ? "#000" : "#fff",
|
|
|
padding: 6,
|
|
|
fontSize: 12,
|
|
|
backColor: style.strokeStyle,
|
|
@@ -756,7 +760,7 @@ export default class Draw {
|
|
|
ctx.save();
|
|
|
help.setVectorStyle(ctx, vector);
|
|
|
ctx.beginPath();
|
|
|
- if (!Settings.screenMode) {
|
|
|
+ if (!isScreenStyle()) {
|
|
|
ctx.arc(
|
|
|
extremePoint.x,
|
|
|
extremePoint.y,
|
|
@@ -1114,7 +1118,7 @@ export default class Draw {
|
|
|
const screenNotDrawTypes = [VectorCategory.Point.NormalPoint];
|
|
|
if (!screenSave) {
|
|
|
if (
|
|
|
- (Settings.screenMode &&
|
|
|
+ (isScreenStyle() &&
|
|
|
(!vector.category || screenNotDrawTypes.includes(vector.category))) ||
|
|
|
vector.category === VectorCategory.Point.TestBasePoint
|
|
|
) {
|
|
@@ -1150,8 +1154,8 @@ export default class Draw {
|
|
|
if (text) {
|
|
|
style = {
|
|
|
...style,
|
|
|
- fillStyle: Settings.screenMode ? "#000" : text.color,
|
|
|
- strokeStyle: Settings.screenMode ? "#000" : text.color,
|
|
|
+ fillStyle: isScreenStyle() ? "#000" : text.color,
|
|
|
+ strokeStyle: isScreenStyle() ? "#000" : text.color,
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -1180,10 +1184,7 @@ export default class Draw {
|
|
|
ctx.restore();
|
|
|
};
|
|
|
|
|
|
- if (
|
|
|
- Settings.selectBasePointId === vector.vectorId &&
|
|
|
- !Settings.screenMode
|
|
|
- ) {
|
|
|
+ if (Settings.selectBasePointId === vector.vectorId && !isScreenStyle()) {
|
|
|
style = {
|
|
|
...style,
|
|
|
fillStyle: "rgba(255, 143, 40, 1)",
|
|
@@ -1276,7 +1277,7 @@ export default class Draw {
|
|
|
}
|
|
|
this.context.save();
|
|
|
const [_, foo] = help.setVectorStyle(this.context, vector);
|
|
|
- const color = Settings.screenMode ? "#000" : vector.color;
|
|
|
+ const color = isScreenStyle() ? "#000" : vector.color;
|
|
|
this.context.fillStyle = color;
|
|
|
this.context.textBaseline = "bottom";
|
|
|
this.context.font = `${
|