missing flat door fix

This commit is contained in:
2020-03-23 22:31:21 +01:00
parent 740552b60e
commit 1544561fda
2 changed files with 13 additions and 4 deletions

View File

@@ -175,8 +175,8 @@ class DDImporter {
var slopenom = (line[0][1] - line[1][1])
if (slopedenom == 0){
if (point[0] == line[0][0]){
if ( (point[1] < line[1][1] && point[1] > line[0][1]) ||
(point[1] > line[1][1] && point[1] < line[0][1])){
if ( (point[1] <= line[1][1] && point[1] >= line[0][1]) ||
(point[1] >= line[1][1] && point[1] <= line[0][1])){
return true
}
}
@@ -185,7 +185,16 @@ class DDImporter {
var slope = slopenom/slopedenom
var intercept = line[1][1] - slope * line[1][0]
return (point[1] == (slope * point[0] + intercept))
let online = (point[1] == (slope * point[0] + intercept))
if (!online) return false
if (( (point[0] <= line[1][0] && point[0] >= line[0][0]) ||
(point[0] >= line[1][0] && point[0] <= line[0][0])) &&
( (point[1] <= line[1][1] && point[1] >= line[0][1]) ||
(point[1] >= line[1][1] && point[1] <= line[0][1])))
{
return true
}
return false
}
static pointsDistance(point1, point2){

View File

@@ -2,7 +2,7 @@
"name": "dd-import",
"title": "DungeonDraft Importer",
"description": "Imports scene elements from Dungeon Draft map files",
"version": "0.4.21",
"version": "0.4.22",
"authors": [
{
"name": "Moo Man"