From d4233f94fed3266ee670098954b5e12b05775c18 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:10:56 +0300 Subject: [PATCH] Backmerge: #2447 - Preview: single up and single down bonds are displayed incorrect when save to PNG(svg) (#2489) --- .../ref/rendering/acs_style.py.out | 2 + .../integration/tests/rendering/acs_style.py | 21 ++- .../tests/rendering/molecules/issue_2447.ket | 142 ++++++++++++++++++ .../tests/rendering/ref/linux/issue_2447.png | Bin 0 -> 2602 bytes .../tests/rendering/ref/mac/issue_2447.png | Bin 0 -> 2602 bytes .../tests/rendering/ref/win/issue_2447.png | Bin 0 -> 2602 bytes core/render2d/render_common.h | 2 +- core/render2d/src/render_common.cpp | 2 +- core/render2d/src/render_context.cpp | 7 +- core/render2d/src/render_internal.cpp | 5 +- 10 files changed, 172 insertions(+), 9 deletions(-) create mode 100644 api/tests/integration/tests/rendering/molecules/issue_2447.ket create mode 100644 api/tests/integration/tests/rendering/ref/linux/issue_2447.png create mode 100644 api/tests/integration/tests/rendering/ref/mac/issue_2447.png create mode 100644 api/tests/integration/tests/rendering/ref/win/issue_2447.png diff --git a/api/tests/integration/ref/rendering/acs_style.py.out b/api/tests/integration/ref/rendering/acs_style.py.out index dd300aca25..185ea4d51a 100644 --- a/api/tests/integration/ref/rendering/acs_style.py.out +++ b/api/tests/integration/ref/rendering/acs_style.py.out @@ -2,3 +2,5 @@ acs_style_default.png rendering status: OK ****** Changed ACS settings ***** acs_style_changed.png rendering status: OK +****** Issue 2447 wrong stereobond width ***** +issue_2447.png rendering status: OK diff --git a/api/tests/integration/tests/rendering/acs_style.py b/api/tests/integration/tests/rendering/acs_style.py index b01501a4e9..656e04e0c3 100644 --- a/api/tests/integration/tests/rendering/acs_style.py +++ b/api/tests/integration/tests/rendering/acs_style.py @@ -64,12 +64,31 @@ indigo.setOption("bond-length", "1.2") indigo.setOption("bond-length-unit", "inch") indigo.setOption("render-bond-spacing", "0.5") -indigo.setOption("render-hash-spacing", "15") +indigo.setOption("render-hash-spacing", "10") indigo.setOption("render-stereo-bond-width", "30") indigo.setOption("render-font-size", "20") renderer.renderToFile(mol, joinPathPy("out/acs_style_changed.png", __file__)) print(checkImageSimilarity("acs_style_changed.png")) +print("****** Issue 2447 wrong stereobond width *****") +indigo.resetOptions() +indigo.setOption("render-output-format", "png") +indigo.setOption("ignore-stereochemistry-errors", "true") +indigo.setOption("bond-length-unit", "px") +indigo.setOption("bond-length", "40") +indigo.setOption("render-bond-thickness", "2") +indigo.setOption("render-bond-thickness-unit", "px") +indigo.setOption("render-stereo-bond-width", "6") +indigo.setOption("render-stereo-bond-width-unit", "px") +indigo.setOption("render-hash-spacing", "1.2") +indigo.setOption("render-hash-spacing-unit", "px") +name = "issue_2447" +fname = name + ".ket" +mol = indigo.loadMoleculeFromFile(joinPathPy("molecules/" + fname, __file__)) +pngname = name + ".png" +renderer.renderToFile(mol, joinPathPy("out/" + pngname, __file__)) +print(checkImageSimilarity(pngname)) + if isIronPython(): renderer.Dispose() indigo.Dispose() diff --git a/api/tests/integration/tests/rendering/molecules/issue_2447.ket b/api/tests/integration/tests/rendering/molecules/issue_2447.ket new file mode 100644 index 0000000000..b2bcbde01e --- /dev/null +++ b/api/tests/integration/tests/rendering/molecules/issue_2447.ket @@ -0,0 +1,142 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ], + "connections": [], + "templates": [] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 9.625074417174607, + -10.015150847871434, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.624589229177204, + -8.284849152128567, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.124966888850187, + -9.148362490508761, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 10.625532067822148, + -8.284849152128567, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.630020056798138, + -10.015150847871434, + 0 + ] + }, + { + "label": "C", + "location": [ + 11.125033111149811, + -9.146179144520442, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 8.12496707469278, + -9.147752830642434, + 0 + ] + }, + { + "label": "C", + "location": [ + 12.125025670104101, + -9.142321420314348, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 6 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/rendering/ref/linux/issue_2447.png b/api/tests/integration/tests/rendering/ref/linux/issue_2447.png new file mode 100644 index 0000000000000000000000000000000000000000..5f39c5de1da69bae72efff7cf7f277ba4c208b60 GIT binary patch literal 2602 zcmV+_3f1+AP)`c78GuYW&Q z193yNzSB-G*Ov`(RO$e%=aqngCZ7qFmom!hzpwK5QpRVS{f=2*Xt(DHjU5~HnC*-; zQ}nzo8B863SwOozSN-Q(>4kH}r>546LJc$5+z_o-g~phvYU(kfbzAL> zW|rLcRI#`rS`3XEW31jQ*Nxq$rWQ+9W9&vF4E6qe;#kbuvMcaURCz;VucCP;+LnI<(-OyG*0L3-;;u~{NC(}Dw&|MGfta=8 zEojWO8I2En#cQZuhB-KKEM`sJMekk+zYJ~LPw_;b<=83o_R_G4z@O1JekgG)WxBya4Qz zI2N=2`wD7=UrilIL^q&qz9n@aW&m#mUPgId_D&m0RJ)-yv?aVC+!7lEevT^RMQKAx zVjl2!-7*H)i1xu*iDR)owG;3cR0%(jIF^)-NBiIzU`paxtPfpI z@zP&(%N=N6EK41T^_S^X*IgczIF>wk16o_V71%d%EY?R>qaI*o>OgX28QL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eCkshqy84U~;V=@(1D z$6^LGLd_m7b5pszpB~O?Ikzjyk5U4T4wP4}!4>6+Nn?QDp_o4&DBqvzqr3Nx7nWIb z3sA*F@qYWb5X1hv3)kQ+DkK+Mvlv@snNi1Q3X9GP+pn%*aEyMVqER2 zO{DzpK=}vht;Gt~gN{L!^jTo{K>6}=d7hILe;LKNCQvpG_+z>J^oTK;we5CPQLhe^ z#l%p&8)Mq1e~s%N3S$ucw-L>VQCbo*!gWdGha-fwJ9DCbklAM9iSfhHD9` zuy?cleR;Kyc3TiRu11bUG5v$^%bC2|xHGkFO$S6DU0Qi1A&8#*CX&2a;hBT~;{-jT6nx%*-PBAA#!tPCu{j`v3p{ M07*qoM6N<$g5qiy5C8xG literal 0 HcmV?d00001 diff --git a/api/tests/integration/tests/rendering/ref/mac/issue_2447.png b/api/tests/integration/tests/rendering/ref/mac/issue_2447.png new file mode 100644 index 0000000000000000000000000000000000000000..5f39c5de1da69bae72efff7cf7f277ba4c208b60 GIT binary patch literal 2602 zcmV+_3f1+AP)`c78GuYW&Q z193yNzSB-G*Ov`(RO$e%=aqngCZ7qFmom!hzpwK5QpRVS{f=2*Xt(DHjU5~HnC*-; zQ}nzo8B863SwOozSN-Q(>4kH}r>546LJc$5+z_o-g~phvYU(kfbzAL> zW|rLcRI#`rS`3XEW31jQ*Nxq$rWQ+9W9&vF4E6qe;#kbuvMcaURCz;VucCP;+LnI<(-OyG*0L3-;;u~{NC(}Dw&|MGfta=8 zEojWO8I2En#cQZuhB-KKEM`sJMekk+zYJ~LPw_;b<=83o_R_G4z@O1JekgG)WxBya4Qz zI2N=2`wD7=UrilIL^q&qz9n@aW&m#mUPgId_D&m0RJ)-yv?aVC+!7lEevT^RMQKAx zVjl2!-7*H)i1xu*iDR)owG;3cR0%(jIF^)-NBiIzU`paxtPfpI z@zP&(%N=N6EK41T^_S^X*IgczIF>wk16o_V71%d%EY?R>qaI*o>OgX28QLd5NF9jv zha>U5c_F(1PoaHteBxNF$BjZ$^(B=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Ikzjyk5U4T4wP4}!4>6+Nn?QDp_o4&DBqvzqr3Nx7nWIb z3sA*F@qYWb5X1hv3)kQ+DkK+Mvlv@snNi1Q3X9GP+pn%*aEyMVqER2 zO{DzpK=}vht;Gt~gN{L!^jTo{K>6}=d7hILe;LKNCQvpG_+z>J^oTK;we5CPQLhe^ z#l%p&8)Mq1e~s%N3S$ucw-L>VQCbo*!gWdGha-fwJ9DCbklAM9iSfhHD9` zuy?cleR;Kyc3TiRu11bUG5v$^%bC2|xHGkFO$S6DU0Qi1A&8#*CX&2a;hBT~;{-jT6nx%*-PBAA#!tPCu{j`v3p{ M07*qoM6N<$g5qiy5C8xG literal 0 HcmV?d00001 diff --git a/api/tests/integration/tests/rendering/ref/win/issue_2447.png b/api/tests/integration/tests/rendering/ref/win/issue_2447.png new file mode 100644 index 0000000000000000000000000000000000000000..5f39c5de1da69bae72efff7cf7f277ba4c208b60 GIT binary patch literal 2602 zcmV+_3f1+AP)`c78GuYW&Q z193yNzSB-G*Ov`(RO$e%=aqngCZ7qFmom!hzpwK5QpRVS{f=2*Xt(DHjU5~HnC*-; zQ}nzo8B863SwOozSN-Q(>4kH}r>546LJc$5+z_o-g~phvYU(kfbzAL> zW|rLcRI#`rS`3XEW31jQ*Nxq$rWQ+9W9&vF4E6qe;#kbuvMcaURCz;VucCP;+LnI<(-OyG*0L3-;;u~{NC(}Dw&|MGfta=8 zEojWO8I2En#cQZuhB-KKEM`sJMekk+zYJ~LPw_;b<=83o_R_G4z@O1JekgG)WxBya4Qz zI2N=2`wD7=UrilIL^q&qz9n@aW&m#mUPgId_D&m0RJ)-yv?aVC+!7lEevT^RMQKAx zVjl2!-7*H)i1xu*iDR)owG;3cR0%(jIF^)-NBiIzU`paxtPfpI z@zP&(%N=N6EK41T^_S^X*IgczIF>wk16o_V71%d%EY?R>qaI*o>OgX28QLd5NF9jv zha>U5c_F(1PoaHteBxNF$BjZ$^(B=4!nSo5+Bc5?J0_0Bde}MiM*53x*#X#q_R+$` zv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r3Nx7nWIb z3sA*F@qYWb5X1hv3)kQ+DkK+Mvlv@snNi1Q3X9GP+pn%*aEyMVqER2 zO{DzpK=}vht;Gt~gN{L!^jTo{K>6}=d7hILe;LKNCQvpG_+z>J^oTK;we5CPQLhe^ z#l%p&8)Mq1e~s%N3S$ucw-L>VQCbo*!gWdGha-fwJ9DCbklAM9iSfhHD9` zuy?cleR;Kyc3TiRu11bUG5v$^%bC2|xHGkFO$S6DU0Qi1A&8#*CX&2a;hBT~;{-jT6nx%*-PBAA#!tPCu{j`v3p{ M07*qoM6N<$g5qiy5C8xG literal 0 HcmV?d00001 diff --git a/core/render2d/render_common.h b/core/render2d/render_common.h index 37883f66c9..7f061df6ee 100644 --- a/core/render2d/render_common.h +++ b/core/render2d/render_common.h @@ -443,7 +443,7 @@ namespace indigo float graphItemSignLineWidth; float graphItemPlusEdge; float stereoBondSpace; - float hashSpacing; + float hashSpacing = -1; float fzz[FONT_SIZE_COUNT]; diff --git a/core/render2d/src/render_common.cpp b/core/render2d/src/render_common.cpp index d87beeadf8..e2b315b91c 100644 --- a/core/render2d/src/render_common.cpp +++ b/core/render2d/src/render_common.cpp @@ -310,7 +310,7 @@ void RenderSettings::init(float relativeThickness, float bondLineWidthFactor, Ac if (acs->stereoBondWidthAngstrom > 0) stereoBondSpace = acs->stereoBondWidthAngstrom / 2.0f; if (acs->hashSpacingAngstrom > 0) - hashSpacing = acs->hashSpacingAngstrom; + hashSpacing = acs->hashSpacingAngstrom + bondLineWidth; } static constexpr float TWO_DIV_THREE = 2.0f / 3.0f; fzz[FONT_SIZE_LABEL] = label_font_size; diff --git a/core/render2d/src/render_context.cpp b/core/render2d/src/render_context.cpp index 89652247b2..fac7dc2613 100644 --- a/core/render2d/src/render_context.cpp +++ b/core/render2d/src/render_context.cpp @@ -129,12 +129,11 @@ RenderContext::RenderContext(const RenderOptions& ropt, float relativeThickness, if (ropt.fontSizeSub > 0) acs.fontSizeSubAngstrom = UnitsOfMeasure::convertToPx(ropt.fontSizeSub, ropt.fontSizeSubUnit, ropt.ppi) / ropt.bond_length_px; if (ropt.bondThickness > 0) - acs.bondThicknessAngstrom = UnitsOfMeasure::convertToPx(ropt.bondThickness, ropt.bondThicknessUnit, ropt.ppi) / LayoutOptions::DEFAULT_BOND_LENGTH_PX; + acs.bondThicknessAngstrom = UnitsOfMeasure::convertToPx(ropt.bondThickness, ropt.bondThicknessUnit, ropt.ppi) / ropt.bond_length_px; if (ropt.stereoBondWidth > 0) - acs.stereoBondWidthAngstrom = - UnitsOfMeasure::convertToPx(ropt.stereoBondWidth, ropt.stereoBondWidthUnit, ropt.ppi) / LayoutOptions::DEFAULT_BOND_LENGTH_PX; + acs.stereoBondWidthAngstrom = UnitsOfMeasure::convertToPx(ropt.stereoBondWidth, ropt.stereoBondWidthUnit, ropt.ppi) / ropt.bond_length_px; if (ropt.hashSpacing > 0) - acs.hashSpacingAngstrom = UnitsOfMeasure::convertToPx(ropt.hashSpacing, ropt.hashSpacingUnit, ropt.ppi) / LayoutOptions::DEFAULT_BOND_LENGTH_PX; + acs.hashSpacingAngstrom = UnitsOfMeasure::convertToPx(ropt.hashSpacing, ropt.hashSpacingUnit, ropt.ppi) / ropt.bond_length_px; if (ropt.bondSpacing > 0) acs.bondSpacing = ropt.bondSpacing; _settings.init(relativeThickness, bondLineWidthFactor, &acs); diff --git a/core/render2d/src/render_internal.cpp b/core/render2d/src/render_internal.cpp index b1ff4b3352..878c850400 100644 --- a/core/render2d/src/render_internal.cpp +++ b/core/render2d/src/render_internal.cpp @@ -4015,13 +4015,14 @@ void MoleculeRenderInternal::_bondSingle(BondDescr& bd, const BondEnd& be1, cons else if (bd.stereodir == BOND_DOWN) { int constexpr min_count = 4; - if (_settings.hashSpacing > 0 && (int)(len / _settings.hashSpacing) > min_count) + auto count = len / (_settings.hashSpacing > 0 ? _settings.hashSpacing : (lw * 2)); + if (_settings.hashSpacing > 0 && count > min_count) { _cw.fillQuadStripesSpacing(r0, l0, r, l, _settings.hashSpacing); } else { - int stripeCnt = std::max((int)((len) / lw / 2), min_count); + int stripeCnt = std::max((int)count, min_count); _cw.fillQuadStripes(r0, l0, r, l, stripeCnt); } }