<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Wrong zoom on point position calculation when hovering an UI marker]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2355&amp;type=atom" />
	<updated>2025-04-08T13:03:24Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2355</id>
		<entry>
			<title type="html"><![CDATA[Re: Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9799#p9799" />
			<content type="html"><![CDATA[<p>I&#039;ve sent you an email with a sample project where you can reproduce the bugs.</p>]]></content>
			<author>
				<name><![CDATA[mikli1]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2745</uri>
			</author>
			<updated>2025-04-08T13:03:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9799#p9799</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9798#p9798" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[mikli1]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2745</uri>
			</author>
			<updated>2025-04-08T10:09:33Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9798#p9798</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9797#p9797" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2025-04-08T09:50:32Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9797#p9797</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Wrong zoom on point position calculation when hovering an UI marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9796#p9796" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[mikli1]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2745</uri>
			</author>
			<updated>2025-04-07T14:09:37Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9796#p9796</id>
		</entry>
</feed>
