slipster216 / VertexPaint

Unity 5.3 Vertex Painter
Other
906 stars 151 forks source link

[Unity 5.4] Brush Cursor Position Error #13

Closed j1jeong closed 7 years ago

j1jeong commented 7 years ago

VertexPainterWindow_Painting.cs

>>>>>>>>>>>>>>> 2076
            float mult = 2;
            if (Application.unityVersion.StartsWith("5.3") )
            {
                mult = 1;
            }
===============
#if UNITY_5_3_OR_NEWER
            float mult = 1;
#else
            float mult = 2;
#endif
<<<<<<<<<<<<<<<
slipster216 commented 7 years ago

This would actually inverse the change as UNITY_5_3_OR_NEWER would be defined on 5.4 as well. Also, that define isn't available on older versions of 5.3, so would raise the minimum level.

That said, I still don't understand why this change seems to be necessary, or if it's potentially causing an issue on other versions of 5.4- I'm not sure why Unity would suddenly require that mouse coordinates be doubled, seems rather strange.

ArieLeo commented 7 years ago

I'm also getting this issue, the Brush transform are not aligned with the cursor.

slipster216 commented 7 years ago

Yeah, on my unity version I have to double the mouse position- I'm not sure why this started as it makes no sense. I'll check in an option for it in a few hours so it can be toggled until I figure out if this is only on a specific patch release or what..

On Thu, Nov 3, 2016 at 1:25 AM, ArieLeo notifications@github.com wrote:

I'm also getting this issue, the Brush transform are not aligned with the cursor.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/13#issuecomment-258066688, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhe8XB89oWagAV4zF4RZKcTJJXKHsBks5q6XA4gaJpZM4KnLE- .

slipster216 commented 7 years ago

Are you on Windows or mac? I'm running on OS X and seem to need this offset on any version of 5.4. I know they added some type of 'Retna' thing to the OS X editor, so maybe that's why?

Sent from my iPhone

On Nov 3, 2016, at 1:25 AM, ArieLeo notifications@github.com wrote:

I'm also getting this issue, the Brush transform are not aligned with the cursor.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

slipster216 commented 7 years ago

Ok, I tried this on 5.4 as well as the latest patch release. On OSX, I still seem to need the multiply by 2 on the mouse coordinates. On Windows, however, it doesn't need this. So for now it only does this on OSX. I also put a support ticket in with Unity, so hopefully they'll get back to me and have some idea of what is going on. I really loath the idea of making this a setting - it should just work.

ArieLeo commented 7 years ago

I'm on windows, this is interesting issues, isn't there a platform dependent check in unity? UNITY_EDITOR_WIN UNITY_EDITOR_OSX

slipster216 commented 7 years ago

Yea, but after further investigation it doesn't seem to be platform specific either; I'm not sure if this is just something happening on my machine, or on others, as Unity support has not been able to repro the issue on their OSX devices..

On Fri, Nov 11, 2016 at 11:37 AM, ArieLeo notifications@github.com wrote:

I'm on windows, this is interesting issues, isn't there a platform dependent check in unity? UNITY_EDITOR_WIN UNITY_EDITOR_OSX

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/slipster216/VertexPaint/issues/13#issuecomment-259997912, or mute the thread https://github.com/notifications/unsubscribe-auth/AMFhe6qtCx0q1hcAhr6QQJrzvLjzKRaIks5q9JnbgaJpZM4KnLE- .

slipster216 commented 7 years ago

This is fixed, seems unity decided to add a constant which is either 1 or 2 depending on what type of monitor you have, and you can multiply by it to get the correct mouse position. Why it just doesn't come that way is beyond me though..