<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QElectroTech — Problem with displaying elements]]></title>
		<link>https://qelectrotech.org/forum/viewtopic.php?id=2401</link>
		<atom:link href="https://qelectrotech.org/forum/extern.php?action=feed&amp;tid=2401&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Problem with displaying elements.]]></description>
		<lastBuildDate>Sat, 28 Jan 2023 15:20:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17530#p17530</link>
			<description><![CDATA[<p> Thanks for your efforts, it works now! </p>]]></description>
			<author><![CDATA[null@example.com (Vbxler)]]></author>
			<pubDate>Sat, 28 Jan 2023 15:20:17 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17530#p17530</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17528#p17528</link>
			<description><![CDATA[<p> Fixed,<br />I use a missile for kill a fly...... </p>]]></description>
			<author><![CDATA[null@example.com (Joshua)]]></author>
			<pubDate>Fri, 27 Jan 2023 18:42:11 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17528#p17528</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17521#p17521</link>
			<description><![CDATA[<p> For QET_ElementScaler I now use this (mathematically correct) determination for the min-max values of an elliptical arc:</p><div class="codebox"><pre><code>    // calculate points on ellipse-circumference:
    // x = a ⋅ cos(t)
    // y = b ⋅ sin(t)
    // with t = 0 .. 2*pi = ([0 .. 360]/360)*2*pi
    // for ARC with x- and y-offset in a loop from Start to (Start+Angle):
    for (int i = Start; i &lt;= (Start + Angle); i++){
        double val_x = X + (Width/2) * (1 + cos((i%360)/360.0*2*pi));
        double val_y = Y + (Height/2) * (1 - sin((i%360)/360.0*2*pi));
        XYMinMax.add(val_x, val_y);
    }</code></pre></div><p>This may be too time-consuming for the productive version of QET, but here I allowed that &quot;luxury-version&quot;...&nbsp; &nbsp;<img src="https://qelectrotech.org/forum/img/smilies/nomicons/wink.png" width="20" alt="nomicons/wink" /><br />Now available here: <a href="https://github.com/plc-user/QET_ElementScaler">https://github.com/plc-user/QET_ElementScaler</a> </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Mon, 23 Jan 2023 22:47:30 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17521#p17521</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17517#p17517</link>
			<description><![CDATA[<p> I will take a look soon about this problem </p>]]></description>
			<author><![CDATA[null@example.com (Joshua)]]></author>
			<pubDate>Mon, 23 Jan 2023 13:38:38 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17517#p17517</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17515#p17515</link>
			<description><![CDATA[<p> Yes, I think you are right, Laurent!<br />In the function starting here:<br /><a href="https://github.com/qelectrotech/qelectrotech-source-mirror/blob/15282292c95dd00898290d5360526f7240fbf81b/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp#L189">https://github.com/qelectrotech/qelectr … y.cpp#L189</a><br />The ELSE branches ensure that only the start and end points of the ARC are used for the calculation of the surrounding RECT size. In this case, this is counterproductive!</p><p>Is there anything against always assuming an &quot;ellipse&quot; for the determination of the surrounding rectangle?<br />(But please don&#039;t expect me to adopt this today: Before I have managed to get familiar with QT-programming and the IDE it will be Christmas again... <img src="https://qelectrotech.org/forum/img/smilies/nomicons/wink.png" width="20" alt="nomicons/wink" />)</p><p>Another thought for ARCs:</p><p>For the determination of the surrounding rectangle, it might be easier to limit the number of case distinctions. For this it might be helpful if (at the latest when saving the XML file) we always keep the angles of the ARC in the positive range?<br />These arcs are identical:<br /></p><div class="codebox"><pre><code>Start = -10 / Angle =  30
Start =  20 / Angle = -30
Start = 350 / Angle =  30</code></pre></div><p>For case distinctions in internal calculations, however, it might help...</p><p>Implemented normalisation for <em>start</em> and <em>angle</em> of ARCs in QET_ElementScaler and just released a new version on github. <br />Maybe it helps... </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sun, 22 Jan 2023 12:23:51 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17515#p17515</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17514#p17514</link>
			<description><![CDATA[<p> I think it&#039;s here:<br /><a href="https://github.com/qelectrotech/qelectrotech-source-mirror/commit/726b300999f184454c019efb63b4443ea8c55daf">https://github.com/qelectrotech/qelectr … 3ea8c55daf</a> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 22 Jan 2023 10:33:15 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17514#p17514</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17513#p17513</link>
			<description><![CDATA[<p> Maybe here?</p><p><a href="https://github.com/qelectrotech/qelectrotech-source-mirror/blob/master/sources/editor/graphicspart/partarc.cpp#L165">https://github.com/qelectrotech/qelectr … c.cpp#L165</a></p><div class="codebox"><pre><code>/**
 * @brief PartArc::sceneGeometricRect
 * @return the minimum,
 * margin-less rectangle this part can fit into in scene coordinates.
 * It is different from boundingRect() because it is not supposed
 * to imply any margin,
 * and it is different from shape because it is a regular
 * rectangle, not a complex shape.
 */
QRectF PartArc::sceneGeometricRect() const
{
    return mapToScene(QetGraphicsHandlerUtility::rectForArc(m_rect, m_start_angle/16, m_span_angle/16)).boundingRect();
}</code></pre></div><p>... or at least in that file? </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sun, 22 Jan 2023 10:14:13 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17513#p17513</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17512#p17512</link>
			<description><![CDATA[<p> Hmm! ok on the 0.7 AppImage, not on 0.8 AppImage ...<br /><span class="postimg"><img src="https://download.qelectrotech.org/qet/forum_img_2/hotspot_calcul_0.7.png" alt="https://download.qelectrotech.org/qet/forum_img_2/hotspot_calcul_0.7.png" /></span> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 22 Jan 2023 10:08:08 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17512#p17512</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17511#p17511</link>
			<description><![CDATA[<p> Yes, I think it does not calculate the extreme position of the ARC primitive, is the case if we stretch the arc into an ellipse :<br /><a href="https://github.com/qelectrotech/qelectrotech-source-mirror/blob/master/sources/editor/elementscene.cpp#L405">https://github.com/qelectrotech/qelectr … e.cpp#L405</a><br /><a href="https://github.com/qelectrotech/qelectrotech-source-mirror/blob/master/sources/qetgraphicsitem/element.cpp#L249">https://github.com/qelectrotech/qelectr … t.cpp#L249</a></p><p>Ctrl + A for selected all parts, is wrong!<br /><span class="postimg"><img src="https://download.qelectrotech.org/qet/forum_img_2/hotspot_calcul.png" alt="https://download.qelectrotech.org/qet/forum_img_2/hotspot_calcul.png" /></span> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 22 Jan 2023 09:29:52 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17511#p17511</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17510#p17510</link>
			<description><![CDATA[<p> I use the same code in QET_ElementScaler:</p><div class="codebox"><pre><code>    // calculation taken from QET-sources:
    int upwidth = ((width/10)*10)+10;
    if ((width%10) &gt; 6) upwidth+=10;

    int upheight = ((height/10)*10)+10;
    if ((height%10) &gt; 6) upheight+=10;</code></pre></div><p>Just a thought, Laurent:<br />Can it be that ARCs aren&#039;t taken into account for calculating Element&#039;s size?<br />The other graphical elements seem to be used for calculating size... </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sun, 22 Jan 2023 09:25:07 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17510#p17510</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17508#p17508</link>
			<description><![CDATA[<p> Hotspot miscalculated the rounding of the arc, a workaroud is to add 2 invisible little line on the two arc center...for the moment. </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 22 Jan 2023 08:54:17 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17508#p17508</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17507#p17507</link>
			<description><![CDATA[<p> </p><div class="quotebox"><cite>Vbxler wrote:</cite><blockquote><p>Nothing changes if I open the component with the component editor and then save it again.</p></blockquote></div><p>You are right, too, Vbxler!</p><p>The definition-line of your Start-Element has these values:<br /></p><div class="codebox"><pre><code>hotspot_y=&quot;14&quot; height=&quot;40&quot; width=&quot;90&quot; hotspot_x=&quot;45&quot;</code></pre></div><p>and shows the graphical errors.<br />The corrected version of the file from QET_ElementScaler has these values:<br /></p><div class="codebox"><pre><code>hotspot_y=&quot;15&quot; height=&quot;40&quot; width=&quot;110&quot; hotspot_x=&quot;55&quot;</code></pre></div><p>and shows perfect graphics.</p><p>When I re-open the corrected file in Element-Editor and save it again, the false values are written to file again. <br />It seems that the calculation of hotspots and size of the element is broken in Element-Editor at the moment... </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sat, 21 Jan 2023 22:28:21 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17507#p17507</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17506#p17506</link>
			<description><![CDATA[<p> </p><div class="quotebox"><cite>scorpio810 wrote:</cite><blockquote><p>This element are a wrong hostspot, just open in editor and save again.</p></blockquote></div><p>You are perfectly right, Laurent!</p><p>Corrected the files from packed file with QET_ElementScaler and added here as *.tar.gz </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sat, 21 Jan 2023 21:40:04 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17506#p17506</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17503#p17503</link>
			<description><![CDATA[<p> It is contained in the 20_logic.7z file:<br /><a href="https://qelectrotech.org/forum/viewtopic.php?id=2385">https://qelectrotech.org/forum/viewtopic.php?id=2385</a></p><p>20_logic/2020_flow_chart/202010_flow_chart/20201000_start.elmt<br />20_logic/2020_flow_chart/202010_flow_chart/20201001_end.elmt </p>]]></description>
			<author><![CDATA[null@example.com (Vbxler)]]></author>
			<pubDate>Sat, 21 Jan 2023 15:23:46 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17503#p17503</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with displaying elements]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=17502#p17502</link>
			<description><![CDATA[<p> Maybe send element here? </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sat, 21 Jan 2023 15:02:50 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=17502#p17502</guid>
		</item>
	</channel>
</rss>
