diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-23 20:47:54 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-23 20:47:54 (GMT) |
commit | f3d16e23b959be4eb05c50e09a880b1e642f3432 (patch) | |
tree | 9e27ce8f230fa3c8645c363a3823d82649839261 /src/dxfdim.cc | |
parent | 64c3be3fd7734f94f1057825ad66ba4ac2393134 (diff) |
Multiple non-MDI assumptions were made, setting CWD and assuming it didn't change. Fix required to pass more context to nodes (functions). It's not totally clean, but it's a start. Fixes bugs: opening multiple files simultaneously only loaded the first file, refreshing an scad file referencing an external file failed if another scad file was opened in the meantime.
git-svn-id: http://svn.clifford.at/openscad/trunk@451 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/dxfdim.cc')
-rw-r--r-- | src/dxfdim.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dxfdim.cc b/src/dxfdim.cc index 4b0cb59..02a1274 100644 --- a/src/dxfdim.cc +++ b/src/dxfdim.cc @@ -29,6 +29,7 @@ #include "dxfdata.h" #include "builtin.h" #include "printutils.h" +#include "context.h" #include <math.h> #include <sys/types.h> @@ -39,7 +40,7 @@ QHash<QString,Value> dxf_dim_cache; QHash<QString,Value> dxf_cross_cache; -Value builtin_dxf_dim(const QVector<QString> &argnames, const QVector<Value> &args) +Value builtin_dxf_dim(const Context *ctx, const QVector<QString> &argnames, const QVector<Value> &args) { QString filename; QString layername; @@ -50,7 +51,7 @@ Value builtin_dxf_dim(const QVector<QString> &argnames, const QVector<Value> &ar for (int i = 0; i < argnames.count() && i < args.count(); i++) { if (argnames[i] == "file") - filename = args[i].text; + filename = ctx->get_absolute_path(args[i].text); if (argnames[i] == "layer") layername = args[i].text; if (argnames[i] == "origin") @@ -124,7 +125,7 @@ Value builtin_dxf_dim(const QVector<QString> &argnames, const QVector<Value> &ar return Value(); } -Value builtin_dxf_cross(const QVector<QString> &argnames, const QVector<Value> &args) +Value builtin_dxf_cross(const Context *ctx, const QVector<QString> &argnames, const QVector<Value> &args) { QString filename; QString layername; @@ -134,7 +135,7 @@ Value builtin_dxf_cross(const QVector<QString> &argnames, const QVector<Value> & for (int i = 0; i < argnames.count() && i < args.count(); i++) { if (argnames[i] == "file") - filename = args[i].text; + filename = ctx->get_absolute_path(args[i].text); if (argnames[i] == "layer") layername = args[i].text; if (argnames[i] == "origin") |