<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Wrong zoom on point position calculation when hovering an UI marker]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2355</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2355&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Wrong zoom on point position calculation when hovering an UI marker.]]></description>
		<lastBuildDate>Tue, 08 Apr 2025 13:03:24 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9799#p9799</link>
			<description><![CDATA[<p>I&#039;ve sent you an email with a sample project where you can reproduce the bugs.</p>]]></description>
			<author><![CDATA[null@example.com (mikli1)]]></author>
			<pubDate>Tue, 08 Apr 2025 13:03:24 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9799#p9799</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9798#p9798</link>
			<description><![CDATA[<p>I have kinda found a problem, the &quot;target&quot; in OnlineMapsRawImageTouchForwarder is storing a reference to my marker, and in the OnGetInputPosition() method there is a line that breaks the for loop iteration: &quot;if (target != forwarder.image.gameObject) continue;&quot;<br />Target is not equal to the map render texture raw image and it does not process the pointer position. When I comment this line is works correctly for me.</p><br /><br /><p>But the 2nd bug when using mouse scrollwheel while having the cursor outside my raw image is still present. The <br /></p><div class="codebox"><pre><code>return cl.Raycast(currentCamera.ScreenPointToRay(position), out lastRaycastHit, OnlineMapsUtils.maxRaycastDistance);</code></pre></div><p> in OnlineMapsTileSetControl is returning true because the ray from map camera hits the map gameobject. But the correct check would be if a ray from my mouse cursor hits the raw image on the UI.</p><p>I&#039;ve tried to do this with <br /></p><div class="codebox"><pre><code>var ped = new UnityEngine.EventSystems.PointerEventData(UnityEngine.EventSystems.EventSystem.current);
ped.position = Input.mousePosition;

List&lt;UnityEngine.EventSystems.RaycastResult&gt; hits = new();
UnityEngine.EventSystems.EventSystem.current.RaycastAll(ped, hits);

return hits.Any(x =&gt; x.gameObject.CompareTag(&quot;MapTexture&quot;));</code></pre></div><p>but somehow this is making the target zoom position wrong. I dont understand why.</p>]]></description>
			<author><![CDATA[null@example.com (mikli1)]]></author>
			<pubDate>Tue, 08 Apr 2025 10:09:33 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9798#p9798</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9797#p9797</link>
			<description><![CDATA[<p>Hello.</p><p>Your problem requires a specific environment, without seeing which I will be looking for a black cat in a dark room.<br />If you send me your project for debugging by email (support@infinity-code.com), I will check what is not working correctly.<br />Otherwise, unfortunately, I don&#039;t know how to help you.</p><p>P.S. I don&#039;t need your working project.<br />Any temporary project where the bug shows itself is enough for me.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 08 Apr 2025 09:50:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9797#p9797</guid>
		</item>
		<item>
			<title><![CDATA[Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9796#p9796</link>
			<description><![CDATA[<p>Hello,<br />I&#039;m using markers with classic Unity UI. I&#039;m not using any of the marker managers. I&#039;m having a markers container just after the map texture in the hierarchy. I&#039;m using a Map render texture and map camera that renders that texture on RawImage. I&#039;m using OnlineMapsRawImageTouchForwarder. </p><p>When I hover over a marker and I use mouse scrollwheel the map zoom is changing. But the input position is wrong - it always zooms to (0, 0). </p><p>Is it somehow possible to fix that?</p><p>Wrong value comes from:<br />OnlineMapsRawImageTouchForwarder.OnGetInputPosition() <br />OnlineMapsControlBase.GetInputPosition()<br />OnlineMapsControlBase.HitTest()<br />OnlineMapsControlBase.UpdateZoom()</p><br /><p>Also when my mouse is outside the raw image (on other part of the UI) mouse scroll wheel still is zooming the map, which is annoying. There should be a check whether I&#039;m over the map on the UI.</p><p>Thanks for help</p>]]></description>
			<author><![CDATA[null@example.com (mikli1)]]></author>
			<pubDate>Mon, 07 Apr 2025 14:09:37 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9796#p9796</guid>
		</item>
	</channel>
</rss>
