Skip to content

Commit

Permalink
#2458 - The reaction with catalysts is displayed incorrectly with AC…
Browse files Browse the repository at this point in the history
…S style setting and after layout (#2637)

Co-authored-by: Aliakasndr Dziarkach <[email protected]>
  • Loading branch information
AliaksandrDziarkach and Aliakasndr Dziarkach authored Nov 18, 2024
1 parent 23bb80b commit 82292ca
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 149 deletions.
52 changes: 26 additions & 26 deletions api/tests/integration/tests/layout/ref/acs_issue_2458.ket
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
"mode": "open-angle",
"pos": [
{
"x": 9.8,
"x": 10.008333,
"y": 0.0,
"z": 0.0
},
{
"x": 20.216667,
"x": 21.674999,
"y": 0.0,
"z": 0.0
}
Expand Down Expand Up @@ -286,8 +286,8 @@
{
"label": "P",
"location": [
10.425,
1.333333,
10.668056,
1.402778,
0.0
]
}
Expand All @@ -300,8 +300,8 @@
{
"label": "P",
"location": [
12.091667,
1.333333,
12.543056,
1.402778,
0.0
]
}
Expand All @@ -314,7 +314,7 @@
{
"label": "O",
"location": [
9.175,
9.348611,
0.0,
0.0
]
Expand All @@ -328,8 +328,8 @@
{
"label": "O",
"location": [
14.591668,
1.333333,
15.390278,
1.402778,
0.0
]
}
Expand All @@ -342,8 +342,8 @@
{
"label": "O",
"location": [
16.258335,
1.333333,
17.265278,
1.402778,
0.0
]
}
Expand All @@ -356,87 +356,87 @@
{
"label": "N",
"location": [
21.258333,
22.820831,
1.309017,
0.0
]
},
{
"label": "C",
"location": [
22.209391,
23.771889,
1.0,
0.0
]
},
{
"label": "C",
"location": [
20.670547,
22.233047,
0.5,
0.0
]
},
{
"label": "C",
"location": [
22.209391,
23.771889,
-0.0,
0.0
]
},
{
"label": "N",
"location": [
23.075417,
24.637915,
1.5,
0.0
]
},
{
"label": "N",
"location": [
21.258333,
22.820833,
-0.309017,
0.0
]
},
{
"label": "C",
"location": [
23.075417,
24.637915,
-0.5,
0.0
]
},
{
"label": "C",
"location": [
23.941441,
25.503941,
1.0,
0.0
]
},
{
"label": "N",
"location": [
23.941441,
25.503941,
0.0,
0.0
]
},
{
"label": "O",
"location": [
23.075415,
24.637915,
-1.5,
0.0
]
},
{
"label": "N",
"location": [
24.807467,
26.369965,
1.5,
0.0
]
Expand Down Expand Up @@ -535,8 +535,8 @@
{
"label": "P",
"location": [
17.091669,
1.333333,
18.168055,
1.402778,
0.0
]
}
Expand All @@ -549,8 +549,8 @@
{
"label": "O",
"location": [
19.591667,
1.333333,
21.015278,
1.402778,
0.0
]
}
Expand Down
4 changes: 3 additions & 1 deletion core/indigo-core/molecule/src/base_molecule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4535,7 +4535,9 @@ void BaseMolecule::getAtomBoundingBox(int atom_idx, float font_size, LABEL_MODE
if (font_size <= EPSILON)
return;

float symbol_size = font_size * 0.6f;
float constexpr WIDTH_FACTOR = 0.7f; // width of font symbols

float symbol_size = font_size * WIDTH_FACTOR;

if (isPseudoAtom(atom_idx) || isTemplateAtom(atom_idx))
{
Expand Down
122 changes: 0 additions & 122 deletions utils/indigo-service/backend/service/tests/api/indigo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,128 +1670,6 @@ def test_check_overlap(self):
result_data["overlapping_atoms"],
)

def test_render_eleptical_arrow(self):
ket = """{
"root": {
"nodes": [
{
"$ref": "mol0"
},
{
"$ref": "mol1"
},
{
"$ref": "mol2"
},
{
"type": "arrow",
"data": {
"mode": "elliptical-arc-arrow-open-angle",
"pos": [
{
"x": 5.799999999999997,
"y": -8.200000000000003,
"z": 0
},
{
"x": 7.205569279687058,
"y": -8.200000000000003,
"z": 0
}
],
"height": 1
}
},
{
"type": "arrow",
"data": {
"mode": "open-angle",
"pos": [
{
"x": 7.775,
"y": -8.225,
"z": 0
},
{
"x": 8.875,
"y": -8.225,
"z": 0
}
]
}
},
{
"type": "plus",
"location": [
6.525,
-8.225,
0
],
"prop": {}
}
],
"connections": [],
"templates": []
},
"mol0": {
"type": "molecule",
"atoms": [
{
"label": "N",
"location": [
5.749999999999999,
-8.350000000000001,
0
]
}
]
},
"mol1": {
"type": "molecule",
"atoms": [
{
"label": "O",
"location": [
7.3999999999999995,
-8.3,
0
]
}
]
},
"mol2": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
9.15,
-8.3,
0
]
}
]
}
}"""
ref_path = joinPathPy("ref/", __file__)
headers, data = self.get_headers(
{
"output_format": "image/png",
"struct": ket,
}
)
result = requests.post(
self.url_prefix + "/render",
headers=headers,
data=data,
)
fname = "render-eleptical-arrow.png"
# with open(os.path.join(ref_path, fname), "wb") as file:
# file.write(result.content)
with open(os.path.join(ref_path, fname), "rb") as file:
ref = file.read()
self.assertEqual(result.content, ref)

def test_check_stereo(self):
# up
headers, data = self.get_headers(
Expand Down
Binary file not shown.

0 comments on commit 82292ca

Please sign in to comment.