From 915d1372e528c3b1aa3d3ffeb70d40c457c6b74b Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 2 Mar 2020 16:54:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=88=E5=B0=94=E6=BB=A8?= =?UTF-8?q?=E8=BD=A6=E7=AB=99=20=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/StationStand/EDetain.js | 21 +++++---- .../shape/StationStand/ESafeEmergent.js | 43 +++++++++++++------ .../shape/StationStand/ETrainDepart.js | 12 +++--- src/jmapNew/shape/StationStand/ETrainStop.js | 12 +++--- 4 files changed, 55 insertions(+), 33 deletions(-) diff --git a/src/jmapNew/shape/StationStand/EDetain.js b/src/jmapNew/shape/StationStand/EDetain.js index d0b199010..16d67df09 100644 --- a/src/jmapNew/shape/StationStand/EDetain.js +++ b/src/jmapNew/shape/StationStand/EDetain.js @@ -21,23 +21,25 @@ class EDetain extends Group { this.isNew = true; if (style.StationStand.common.special) { // inside true 内侧 + const gag = 22; + const gagX = 6; // 左右间隔 let height = ''; let position = ''; if (model.right) { if (model.inside) { - height = -30; - position = -model.width / 4; + height = -gag; + position = -model.width / 4 - gagX; } else { - height = 30; - position = model.width / 4; + height = gag; + position = model.width / 4 + gagX; } } else { if (model.inside) { - height = 30; - position = model.width / 4; + height = gag; + position = model.width / 4 + gagX; } else { - height = -30; - position = -model.width / 4; + height = -gag; + position = -model.width / 4 - gagX; } } this.detain = new Text({ @@ -48,7 +50,8 @@ class EDetain extends Group { x: model.x + position, y: model.y + height, text: textName, - textAlign: model.inside ? 'left' : 'right', + // textAlign: model.inside ? 'left' : 'right', + textAlign: 'center', fontWeight: 'blod', fontSize: `${style.StationStand.detainCar.fontSize} px ${style.fontFamily}`, textFill: textName == 'E' ? '#fff' : 'red', diff --git a/src/jmapNew/shape/StationStand/ESafeEmergent.js b/src/jmapNew/shape/StationStand/ESafeEmergent.js index fd2db533f..3543df357 100644 --- a/src/jmapNew/shape/StationStand/ESafeEmergent.js +++ b/src/jmapNew/shape/StationStand/ESafeEmergent.js @@ -19,23 +19,42 @@ class ESafeEmergent extends Group { this.isNew = true; if (style.StationStand.common.special) { - const height = model.inside ? model.y + 26 : model.y - 33; - const width = model.inside ? model.x + model.width / 8 : model.x - model.width / 8; + const gagT = 19; + const gagB = 26; + let cy = model.inside ? model.y + 22 : model.y - 22; + let cx = model.inside ? model.x + model.width / 8 : model.x - model.width / 8; + if (model.right) { + if (model.inside) { + cy = model.y - gagB; + cx = model.x - model.width / 8; + } else { + cy = model.y + gagT; + cx = model.x + model.width / 8; + } + } else { + if (model.inside) { + cy = model.y + gagT; + cx = model.x + model.width / 8; + } else { + cy = model.y - gagB; + cx = model.x - model.width / 8; + } + } this.emergent = new Polyline({ zlevel: model.zlevel, z: model.z, shape: { points: [ - [width, height - 3], - [width + 7, height], - [width + 7, height + 3], - [width + 3, height + 3], - [width + 3, height + 10], - [width - 3, height + 10], - [width - 3, height + 3], - [width - 7, height + 3], - [width - 7, height], - [width, height - 3] + [cx, cy - 2], + [cx + 5, cy], + [cx + 5, cy + 2], + [cx + 2, cy + 2], + [cx + 2, cy + 6], + [cx - 2, cy + 6], + [cx - 2, cy + 2], + [cx - 5, cy + 2], + [cx - 5, cy], + [cx, cy - 2] ] }, style: { diff --git a/src/jmapNew/shape/StationStand/ETrainDepart.js b/src/jmapNew/shape/StationStand/ETrainDepart.js index 74104659c..ec6f08a13 100644 --- a/src/jmapNew/shape/StationStand/ETrainDepart.js +++ b/src/jmapNew/shape/StationStand/ETrainDepart.js @@ -14,24 +14,24 @@ class ETrainDepart extends Group { if (!this.isNew) { const model = this.model; const style = this.model.style; - + const gag = 22; this.isNew = true; - let cy = model.inside ? model.y + 30 : model.y - 30; + let cy = model.inside ? model.y + gag : model.y - gag; let cx = model.inside ? model.x - model.width / 4 - model.width / 8 : model.x + model.width / 4 + model.width / 8; if (model.right) { if (model.inside) { - cy = model.y - 30; + cy = model.y - gag; cx = model.x + model.width / 4 + model.width / 8; } else { - cy = model.y + 30; + cy = model.y + gag; cx = model.x - model.width / 4 - model.width / 8; } } else { if (model.inside) { - cy = model.y + 30; + cy = model.y + gag; cx = model.x - model.width / 4 - model.width / 8; } else { - cy = model.y - 30; + cy = model.y - gag; cx = model.x + model.width / 4 + model.width / 8; } } diff --git a/src/jmapNew/shape/StationStand/ETrainStop.js b/src/jmapNew/shape/StationStand/ETrainStop.js index f85afb5dc..f8557cea3 100644 --- a/src/jmapNew/shape/StationStand/ETrainStop.js +++ b/src/jmapNew/shape/StationStand/ETrainStop.js @@ -11,24 +11,24 @@ class ETrainStop extends Group { create() { if (!this.isNew) { const model = this.model; - + const gag = 22; this.isNew = true; - let cy = model.inside ? model.y + 30 : model.y - 30; + let cy = model.inside ? model.y + gag : model.y - gag; let cx = model.inside ? model.x - model.width / 8 : model.x + model.width / 8; if (model.right) { if (model.inside) { - cy = model.y - 30; + cy = model.y - gag; cx = model.x + model.width / 8; } else { - cy = model.y + 30; + cy = model.y + gag; cx = model.x - model.width / 8; } } else { if (model.inside) { - cy = model.y + 30; + cy = model.y + gag; cx = model.x - model.width / 8; } else { - cy = model.y - 30; + cy = model.y - gag; cx = model.x + model.width / 8; } }