Spodii / netgore

Cross platform online rpg engine using C# and SFML
http://www.netgore.com/
40 stars 16 forks source link

Zooming Out Too Far in Skeleton Editor Throws Exception #354

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As shown in this video: http://youtu.be/IeqhGNe5piE

When using the "7" key on the number pad - which is used to zoom out - the 
below exception is thrown:

---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
Unhandled exception caught: System.ArgumentOutOfRangeException: Specified 
argument was out of the range of valid values.

Parameter name: value

   at NetGore.Graphics.Camera2D.set_Scale(Single value) in C:\NetGore\NetGore\Graphics\Camera\Camera2D.cs:line 154

   at NetGore.Graphics.Camera2D.Zoom(Vector2 origin, Vector2 size, Single scale) in C:\NetGore\NetGore\Graphics\Camera\Camera2D.cs:line 336

   at DemoGame.Editor.SkeletonEditorForm.OnKeyDown(KeyEventArgs e) in C:\NetGore\DemoGame.Editor\Forms\Dockable\SkeletonEditorForm.cs:line 488

   at DemoGame.Editor.SkeletonEditorForm.KeyDownForward(Object sender, KeyEventArgs e) in C:\NetGore\DemoGame.Editor\Forms\Dockable\SkeletonEditorForm.cs:line 408

   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)

   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)

   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    at WinFormExceptionHelper.Application_ThreadException(Object sender, ThreadExceptionEventArgs e)  C:\NetGore\NetGore.Editor\WinForms\WinFormExceptionHelper.cs(30)

    at ThreadContext.OnThreadException(Exception t)  

    at Control.WndProcException(Exception e)  

    at ControlNativeWindow.OnThreadException(Exception e)  

    at NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)  

    at UnsafeNativeMethods.DispatchMessageW(MSG& msg)  

    at ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)  

    at ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)  

    at ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)  

    at Application.Run(Form mainForm)  

    at Program.Main(String[] args)  C:\NetGore\DemoGame.Editor\Program.cs(198)

---------------------------
Abort   Retry   Ignore   
---------------------------

Original issue reported on code.google.com by kevindatapaw on 14 Feb 2013 at 5:07

GoogleCodeExporter commented 9 years ago
This is meant to happen. You can change the ArgumentOutOfRangeException to a 
return if you want or just hit ignore when the exception occurs. Also, I've 
noticed from this that the ApplyKeepInMap method isn't being called correctly 
so when zooming out, you can lose sight of the skeleton. You mat want to raise 
a separate issue for this.

I'll Cc Spodi and see if he is happy for this issue to be closed. If someone 
wants me to change the exception line to a return then let me know and I'll 
commit this.

Thanks.

Original comment by darksumm...@gmail.com on 17 Feb 2013 at 9:47

GoogleCodeExporter commented 9 years ago
may**

Original comment by darksumm...@gmail.com on 17 Feb 2013 at 9:47

GoogleCodeExporter commented 9 years ago
Hmmmm, shouldn't it just stop you from zooming out? I mean, a user will only 
need to zoom so far out before you're dealing with a body that would take up 
more than the max resolution of the most advanced computer monitor.
/Un-OverExaggerate

In all seriousness though, it might work better as simply a return.

As for "ApplyKeepInMap" I had noticed that the body was getting lost out of 
sight, but again, zooming out doesn't really become a real issue until you go 
ridiculous distances.
I'll report it since it is a bug, but first I will take a look and see if I can 
fix it with my mediocre C# skills and get off my lazy butt.
Thanks for the heads up!

Original comment by kevindatapaw on 17 Feb 2013 at 10:50

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r4760.

Original comment by darksumm...@gmail.com on 18 Feb 2013 at 7:40