mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-13 02:37:57 +01:00
Minor fixes.
This commit is contained in:
parent
10a1bf929f
commit
9a8c2a0e97
@ -57,12 +57,13 @@ class CentralTopic extends Topic {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** */
|
||||
workoutOutgoingConnectionPoint(targetPosition: Point) {
|
||||
$assert(targetPosition, 'targetPoint can not be null');
|
||||
|
||||
const pos = this.getPosition();
|
||||
const isAtRight = Shape.isAtRight(targetPosition, pos);
|
||||
const size = this.getSize();
|
||||
|
||||
return Shape.calculateRectConnectionPoint(pos, size, !isAtRight);
|
||||
}
|
||||
}
|
||||
|
@ -1020,11 +1020,11 @@ abstract class Topic extends NodeGraph {
|
||||
}
|
||||
}
|
||||
|
||||
this.redrawShapeType();
|
||||
this.redraw(true);
|
||||
|
||||
// Remove from workspace.
|
||||
EventBus.instance.fireEvent('topicDisconect', this.getModel());
|
||||
|
||||
this.redrawShapeType();
|
||||
this.redraw(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1088,13 +1088,11 @@ abstract class Topic extends NodeGraph {
|
||||
children.push(child);
|
||||
}
|
||||
|
||||
/** */
|
||||
removeChild(child: Topic): void {
|
||||
const children = this.getChildren();
|
||||
this._children = children.filter((c) => c !== child);
|
||||
}
|
||||
|
||||
/** */
|
||||
getChildren(): Topic[] {
|
||||
let result = this._children;
|
||||
if (!$defined(result)) {
|
||||
@ -1135,12 +1133,10 @@ abstract class Topic extends NodeGraph {
|
||||
this.redraw();
|
||||
}
|
||||
|
||||
/** */
|
||||
isInWorkspace(): boolean {
|
||||
return this._isInWorkspace;
|
||||
}
|
||||
|
||||
/** */
|
||||
createDragNode(layoutManager: LayoutManager) {
|
||||
const result = super.createDragNode(layoutManager);
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Point } from '@wisemapping/web2d';
|
||||
import { $assert, $defined } from '@wisemapping/core-js';
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import TopicConfig from '../TopicConfig';
|
||||
import PositionType from '../PositionType';
|
||||
import SizeType from '../SizeType';
|
||||
@ -24,8 +24,6 @@ import Topic from '../Topic';
|
||||
|
||||
class Shape {
|
||||
static isAtRight(sourcePoint: PositionType, targetPoint: PositionType): boolean {
|
||||
$assert(sourcePoint, 'Source can not be null');
|
||||
$assert(targetPoint, 'Target can not be null');
|
||||
return sourcePoint.x < targetPoint.x;
|
||||
}
|
||||
|
||||
@ -34,10 +32,6 @@ class Shape {
|
||||
rectSize: SizeType,
|
||||
isAtRight: boolean,
|
||||
): PositionType {
|
||||
$assert(rectCenterPoint, 'rectCenterPoint can not be null');
|
||||
$assert(rectSize, 'rectSize can not be null');
|
||||
$assert($defined(isAtRight), 'isRight can not be null');
|
||||
|
||||
// This is used fix a minor difference ...z
|
||||
const correctionHardcode = 2;
|
||||
let result: PositionType;
|
||||
@ -138,8 +132,6 @@ class Shape {
|
||||
result.x -= offset;
|
||||
}
|
||||
|
||||
result.x = Math.ceil(result.x);
|
||||
result.y = Math.ceil(result.y);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ class CurvedLinePeer extends ElementPeer {
|
||||
}
|
||||
|
||||
static _pointToStr(x, y) {
|
||||
return `${(x).toFixed()},${(y).toFixed(1)} `;
|
||||
return `${x.toFixed(1)},${y.toFixed(1)} `;
|
||||
}
|
||||
|
||||
_updateStyle() {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Loading…
Reference in New Issue
Block a user