Commit 4bce295d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '736-overlapping-compartments' into 'devel_12.2.x'

Resolve "Overlapping compartments in non-layout SBML upload"

See merge request minerva/core!689
parents 325b1a46 b3c07cba
......@@ -6,8 +6,10 @@ minerva (12.2.0~beta.3) unstable; urgency=medium
invalid (#735)
* Bug fix: closing Add Project window was taking infinity (#734)
* Bug fix: align of checkboxes in top right corner fixed (#733)
* Bug fix: uploading SBML file without layout resulted in overlapping
compartments (#736)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 6 Mar 2019 17:00:00 +0200
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 6 Mar 2019 14:00:00 +0200
minerva (12.2.0~beta.2) unstable; urgency=medium
* Bug fix: order of the overlays is defined explicitly also for general
......
......@@ -219,7 +219,7 @@ public class ApplySimpleLayoutModelCommand extends ApplyLayoutModelCommand {
minPoint.getY() + COMPARTMENT_BORDER, dimension.getWidth() - COMPARTMENT_BORDER * 2,
dimension.getHeight() - COMPARTMENT_BORDER * 2);
for (Element element : compartment.getElements()) {
if (!elements.contains(element) && element.getBorder()!=null) {
if (!elements.contains(element) && element.getBorder() != null && element.getX() != 0 && element.getY() != 0) {
border.add(element.getBorder());
}
}
......
......@@ -151,7 +151,7 @@ public interface Model {
* @param elements
* list of elements
*/
void addElements(List<? extends Element> elements);
void addElements(Collection<? extends Element> elements);
/**
* Sets new short description of the model.
......
......@@ -198,7 +198,7 @@ public class ModelFullIndexed implements Model {
}
@Override
public void addElements(List<? extends Element> elements) {
public void addElements(Collection<? extends Element> elements) {
for (Element element : elements) {
addElement(element);
}
......
......@@ -322,7 +322,7 @@ public abstract class Element implements BioEntity, Serializable, SbmlArgument {
* @see x
*/
public void setX(String string) {
this.x = Double.parseDouble(string);
setX(Double.parseDouble(string));
}
/**
......@@ -483,7 +483,7 @@ public abstract class Element implements BioEntity, Serializable, SbmlArgument {
* @return rectangle border
*/
public Rectangle2D getBorder() {
if (x == null || y == null || width == null || height == null) {
if (x == null || y == null || width == null || height == null || width == 0.0 || height == 0.0) {
return null;
}
return new Rectangle2D.Double(x, y, width, height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment