Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
vadere
vadere
Commits
5299ffa4
Commit
5299ffa4
authored
Dec 13, 2016
by
Jakob Schöttl
Browse files
Bugfix: element must not be selected for copy&paste
parent
fd353205
Changes
3
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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