Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
vadere
vadere
Commits
5299ffa4
Commit
5299ffa4
authored
Dec 13, 2016
by
Jakob Schöttl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: element must not be selected for copy&paste
parent
fd353205
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
VadereGui/src/org/vadere/gui/topographycreator/control/ActionInsertCopiedElement.java
.../topographycreator/control/ActionInsertCopiedElement.java
+1
-1
VadereGui/src/org/vadere/gui/topographycreator/model/IDrawPanelModel.java
...g/vadere/gui/topographycreator/model/IDrawPanelModel.java
+2
-0
VadereGui/src/org/vadere/gui/topographycreator/model/TopographyCreatorModel.java
...e/gui/topographycreator/model/TopographyCreatorModel.java
+7
-3
No files found.
VadereGui/src/org/vadere/gui/topographycreator/control/ActionInsertCopiedElement.java
View file @
5299ffa4
...
...
@@ -44,7 +44,7 @@ public class ActionInsertCopiedElement extends TopographyAction {
VPoint
elementPos
=
getElementPosition
(
elementToCopy
);
VPoint
diff
=
model
.
getMousePosition
().
subtract
(
elementPos
);
VShape
newShape
=
model
.
translate
(
diff
);
VShape
newShape
=
model
.
translate
Element
(
elementToCopy
,
diff
);
if
(
elementToCopy
instanceof
AgentWrapper
)
{
VPoint
position
=
new
VPoint
(
newShape
.
getBounds2D
().
getCenterX
(),
newShape
.
getBounds2D
().
getCenterY
());
...
...
VadereGui/src/org/vadere/gui/topographycreator/model/IDrawPanelModel.java
View file @
5299ffa4
...
...
@@ -165,4 +165,6 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<
void
setCopiedElement
(
ScenarioElement
copiedElement
);
VShape
translate
(
VPoint
vector
);
VShape
translateElement
(
ScenarioElement
elementToCopy
,
VPoint
diff
);
}
VadereGui/src/org/vadere/gui/topographycreator/model/TopographyCreatorModel.java
View file @
5299ffa4
...
...
@@ -329,15 +329,19 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo
@Override
public
VShape
translate
(
final
Point
vector
)
{
// double factor = Math.max(10,1/getGridResulution());
VPoint
worldVector
=
new
VPoint
(
vector
.
x
/
getScaleFactor
(),
-
vector
.
y
/
getScaleFactor
());
return
translate
(
worldVector
);
}
@Override
public
VShape
translate
(
final
VPoint
vector
)
{
// double factor = Math.max(10,1/getGridResulution());
return
getSelectedElement
().
getShape
().
translatePrecise
(
alignToGrid
(
vector
));
return
translateElement
(
getSelectedElement
(),
vector
);
}
@Override
public
VShape
translateElement
(
ScenarioElement
elementToCopy
,
VPoint
vector
)
{
// double factor = Math.max(10,1/getGridResulution()); // ?? related to scaleTopography?
return
elementToCopy
.
getShape
().
translatePrecise
(
alignToGrid
(
vector
));
}
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment