From 85ecc4c8e1043833b73df94a9b42072914b886f1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:27:52 +0300 Subject: [PATCH] #2512 - Equilibrium Half Arrows are displayed incorrect when saved to PNG (svg) by default size (#2537) --- .../ref/rendering/render_reactions.py.out | 2 + .../tests/rendering/reactions/issue_2512.ket | 141 ++++++++++++++++++ .../tests/rendering/ref/linux/issue_2512.png | Bin 0 -> 4497 bytes .../tests/rendering/ref/mac/issue_2512.png | Bin 0 -> 4497 bytes .../tests/rendering/ref/win/issue_2512.png | Bin 0 -> 4497 bytes .../tests/rendering/render_reactions.py | 12 ++ core/render2d/src/render_context.cpp | 13 +- 7 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 api/tests/integration/tests/rendering/reactions/issue_2512.ket create mode 100644 api/tests/integration/tests/rendering/ref/linux/issue_2512.png create mode 100644 api/tests/integration/tests/rendering/ref/mac/issue_2512.png create mode 100644 api/tests/integration/tests/rendering/ref/win/issue_2512.png diff --git a/api/tests/integration/ref/rendering/render_reactions.py.out b/api/tests/integration/ref/rendering/render_reactions.py.out index 6e83fd63a8..7d74ddb834 100644 --- a/api/tests/integration/ref/rendering/render_reactions.py.out +++ b/api/tests/integration/ref/rendering/render_reactions.py.out @@ -11,3 +11,5 @@ issue 2457 wrong chiral label position issue_2457.png rendering status: OK issue 2444 wrong arrow and plus width issue_2444.png rendering status: OK +issue 2512 two short equilibrium half arrows +issue_2512.png rendering status: OK diff --git a/api/tests/integration/tests/rendering/reactions/issue_2512.ket b/api/tests/integration/tests/rendering/reactions/issue_2512.ket new file mode 100644 index 0000000000..f108c02bb4 --- /dev/null +++ b/api/tests/integration/tests/rendering/reactions/issue_2512.ket @@ -0,0 +1,141 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + }, + { + "$ref": "mol1" + }, + { + "type": "arrow", + "data": { + "mode": "unbalanced-equilibrium-filled-half-triangle", + "pos": [ + { + "x": 13.700000000000001, + "y": -7.95, + "z": 0 + }, + { + "x": 14.700000000000001, + "y": -7.95, + "z": 0 + } + ] + } + } + ], + "connections": [], + "templates": [] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 12.549374214363931, + -8.432470415521406, + 0 + ] + }, + { + "label": "C", + "location": [ + 13.55062578563607, + -8.432470415521406, + 0 + ] + }, + { + "label": "C", + "location": [ + 13.050050188048687, + -7.567529584478595, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + } + ], + "stereoFlagPosition": { + "x": 13.55062578563607, + "y": 6.567529584478595, + "z": 0 + } + }, + "mol1": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 14.774374214363931, + -8.482470415521407, + 0 + ] + }, + { + "label": "C", + "location": [ + 15.77562578563607, + -8.482470415521407, + 0 + ] + }, + { + "label": "C", + "location": [ + 15.275050188048686, + -7.6175295844785955, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/rendering/ref/linux/issue_2512.png b/api/tests/integration/tests/rendering/ref/linux/issue_2512.png new file mode 100644 index 0000000000000000000000000000000000000000..8ede11ca25ae77d3b99d42a97bef4f789345a966 GIT binary patch literal 4497 zcmX9?2Q-^+A60u(Ge(C|)v8rhwOV5Dpw)<4rGnU-D7E*DRjalRn@E(HRaL94N+TjD z)%Gunme_o+^PQZN{zCUKB1>U=c zIB>uR<6{#8U7FLgR|T#fMMHC5-$+;cepu;x84|)jLpM@b&*EyCovWWvlfszd?nbXq zOrw2u&O`T>C5Yjw)>Zne?zu@Z?iyAVR%C;6bhv@Kc7Kl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BB~f=Pl(W&;QS>8E{qu>bP~ z!fss-nU#?N6h5z)L@ls=k)psp6uC3=5c{J@83@RHcj$6K922@j%6k{vO_`X45z&Z3 zX*ILBIgIa+zcMf^0QQcDw{UaKw4g!I~HdsTYXnZ_8wzjq`rTHp$q{YNyDoI1NCWX1VxmvQgW9nRf zem<7}`T6VlAE&08TU&FSLF($=|9(ylT`XQT1%?U-hl|h?AOlVZ-!D8H!}!dzF8r~= zDm?kfN8FZ{0+7qvbpj>EN-6KMxOdzEnaSBNNy|l6-i5k_tm%qxUj`-a= zauH<(Xs~+dpZJHXfK8q~J(wa>nrQjv!@|Q;qIf2X0V09!GjWRc%O>4e3Frb0_DfN8 zN1b{f?i%0YuCT4Dq@j4D|G6{oV6# zQr+pjg^9^nqaDVxq?I&23%L1L*7ZfFOfvg>dkX9>8Fu^$RcR+DC&0KC_oUWpbdpfv z4vg*>G$Z&3C3kVxYLsr>T3KDifBTkXm+X=K{5gwDrRGiB|+Twgz5Rg?z_#MI4bZT3yqPUxo#8KDfWLdQq~aw literal 0 HcmV?d00001 diff --git a/api/tests/integration/tests/rendering/ref/mac/issue_2512.png b/api/tests/integration/tests/rendering/ref/mac/issue_2512.png new file mode 100644 index 0000000000000000000000000000000000000000..8ede11ca25ae77d3b99d42a97bef4f789345a966 GIT binary patch literal 4497 zcmX9?2Q-^+A60u(Ge(C|)v8rhwOV5Dpw)<4rGnU-D7E*DRjalRn@E(HRaL94N+TjD z)%Gunme_o+^PQZN{zCUKB1>U=c zIB>uR<6{#8U7FLgR|T#fMMHC5-$+;cepu;x84|)jLpM@b&*EyCovWWvlfszd?nbXq zOrw2u&O`T>C5Yjw)>Zne?zu@Z?iyAVR%C;6bhv@Kc7KlrnscU z#KdIFs2cJoJ3pUaNGN=<|D2=a!pTV#DWIcTJiWA3^krjBjc%<~MtZu&&R6S2R0{7^ za!)ufMnBay@W)4fCMKq^{NB@(LoB~X!VTo^&W`40KV1dB{3+G8>k;SO=BB1Z^z*#D z_=l3i<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YNyDoI1NCWX1VxmvQgW9nRf zem<7}`T6VlAE&08TU&FSLF($=|9(ylT`XQT1%?U-hl|h?AOlVZ-!D8H!}!dzF8r~= zDm?kfN8FZ{0+7qvbpj>EN-6KMxOdzEnaSBNNy|l6-i5k_tm%qxUj`-a= zauH<(Xs~+dpZJHXfK8q~J(wa>nrQjv!@|Q;qIf2X0V09!GjWRc%O>4e3Frb0_DfN8 zN1b{f?i%0YuCT4Dq@j4D|G6{oV6# zQr+pjg^9^nqaDVxq?I&23%L1L*7ZfFOfvg>dkX9>8Fu^$RcR+DC&0KC_oUWpbdpfv z4vg*>G$Z&3C3kVxYLsr>T3KDifBTkXm+X=K{5gwDrRGiB|+Twgz5Rg?z_#MI4bZT3yqPUxo#8KDfWLdQq~aw literal 0 HcmV?d00001 diff --git a/api/tests/integration/tests/rendering/ref/win/issue_2512.png b/api/tests/integration/tests/rendering/ref/win/issue_2512.png new file mode 100644 index 0000000000000000000000000000000000000000..8ede11ca25ae77d3b99d42a97bef4f789345a966 GIT binary patch literal 4497 zcmX9?2Q-^+A60u(Ge(C|)v8rhwOV5Dpw)<4rGnU-D7E*DRjalRn@E(HRaL94N+TjD z)%Gunme_o+^PQZN{zCUKB1>U=c zIB>uR<6{#8U7FLgR|T#fMMHC5-$+;cepu;x84|)jLpM@b&*EyCovWWvlfszd?nbXq zOrw2u&O`T>C5Yjw)>Zne?zu@Z?iyAVR%C;6bhv@Kc7KlrnscU z#KdIFs2cJoJ3pUaNGN=<|D2=a!pTV#DWIcTJiWA3^krjBjc%<~MtZu&&R6S2R0{7^ za!)ufMnBay@W)4fCMKq^{NB@(LoB~X!VTo^&W`40KV1dB{3+G8>k;SO=BB1Z^z*#D z_=l3i<0;9>PWLW1Ha5-?iGFEc*lnqqsj0DO>T=e-w$q*e-ZaNfd3$?zzkTa>t)@uz zszrJH1kT3B#>x3}l^! zXIm5x^7BhhNr|zjE-n@({dY?%8+Uwkq-BE6lr;k4Z*Zb3mNM0-<{c~A^rAbhG^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= zauH<(Xs~+dpZJHXfK8q~J(wa>nrQjv!@|Q;qIf2X0V09!GjWRc%O>4e3Frb0_DfN8 zN1b{f?i%0YuCT4Dq@j4D|G6{oV6# zQr+pjg^9^nqaDVxq?I&23%L1L*7ZfFOfvg>dkX9>8Fu^$RcR+DC&0KC_oUWpbdpfv z4vg*>G$Z&3C3kVxYLsr>T3KDifBTkXm+X=K{5gwDrRGiB|+Twgz5Rg?z_#MI4bZT3yqPUxo#8KDfWLdQq~aw literal 0 HcmV?d00001 diff --git a/api/tests/integration/tests/rendering/render_reactions.py b/api/tests/integration/tests/rendering/render_reactions.py index 26ad2380f8..2b3d8cd68d 100644 --- a/api/tests/integration/tests/rendering/render_reactions.py +++ b/api/tests/integration/tests/rendering/render_reactions.py @@ -93,6 +93,18 @@ def renderRxnfile(filename, outfile): renderer.renderToFile(rxn, joinPathPy("out/" + png_fname, __file__)) print(checkImageSimilarity(png_fname)) +print("issue 2512 two short equilibrium half arrows") +indigo.resetOptions() +indigo.setOption("ignore-stereochemistry-errors", "true") +indigo.setOption("render-background-color", "255, 255, 255") +indigo.setOption("render-output-format", "png") +fname = "issue_2512" +png_fname = fname + ".png" +ket_fname = joinPathPy("reactions/%s.ket" % fname, __file__) +rxn = indigo.loadReactionFromFile(ket_fname) +renderer.renderToFile(rxn, joinPathPy("out/" + png_fname, __file__)) +print(checkImageSimilarity(png_fname)) + if isIronPython(): renderer.Dispose() indigo.Dispose() diff --git a/core/render2d/src/render_context.cpp b/core/render2d/src/render_context.cpp index fac7dc2613..43f086914d 100644 --- a/core/render2d/src/render_context.cpp +++ b/core/render2d/src/render_context.cpp @@ -1337,11 +1337,20 @@ void RenderContext::drawEquillibriumHalf(const Vec2f& p1, const Vec2f& p2, const n.negate(); pa.addScaled(n, headwidth); pb.addScaled(n, headwidth); + const float default_shift = headsize * 2.0f; + float shift = default_shift; + if ((len - shift * 2.0f) < default_shift) + { + if (len < default_shift * 2.0f) + shift = len / 4.0f; // too short arrow - shift will be 1/4 of arrow length, short part - 1/2 + else + shift = (len - default_shift) / 2.0f; // short part of arrow will be headsize*2 + } if (is_unbalanced) - pa.addScaled(d, headsize * 2); + pa.addScaled(d, shift); d.negate(); if (is_unbalanced) - pb.addScaled(d, headsize * 2); + pb.addScaled(d, shift); drawHalfArrowHeader(pa, d, width, headwidth * width_scale, headsize, arrow_type); drawBar(pb, pa, width, margin); checkPathNonEmpty();