diff --git a/app/src/gambas3/.src/Editor/Image/FImageEditor.class b/app/src/gambas3/.src/Editor/Image/FImageEditor.class index 855c85638..6ac63c9f5 100644 --- a/app/src/gambas3/.src/Editor/Image/FImageEditor.class +++ b/app/src/gambas3/.src/Editor/Image/FImageEditor.class @@ -892,8 +892,12 @@ Public Sub imvImage_MouseDown() Case "move" - $SX = imvImage.ScrollX - $SY = imvImage.ScrollY + If $bReadOnly Then + $SX = imvImage.ScrollX + $SY = imvImage.ScrollY + Else + $hLastPoint = GetImagePos() + Endif Case "draw", "erase" @@ -1257,7 +1261,11 @@ Public Sub imvImage_MouseMove() Case "move" - imvImage.Scroll($SX - (Mouse.X - Mouse.StartX), $SY - (Mouse.Y - Mouse.StartY)) + If $bReadOnly Then + imvImage.Scroll($SX - (Mouse.X - Mouse.StartX), $SY - (Mouse.Y - Mouse.StartY)) + Else + imvImage.Refresh + Endif Case "draw", "erase" @@ -1664,6 +1672,18 @@ Public Sub imvImage_MouseUp() Select Case $sTool + Case "move" + + If Not $bReadOnly Then + + hImage = New Image($hImage.W, $hImage.H, Color.Transparent) + Paint.Begin(hImage) + Paint.DrawImage($hImage, CInt($hCurrentPoint.X - $hLastPoint.X), CInt($hCurrentPoint.Y - $hLastPoint.Y)) + Paint.End + SetImage(hImage) + + Endif + Case "draw", "erase" If Not $bShift Then @@ -1942,7 +1962,14 @@ Public Sub imvImage_Draw(hZoom As Image) Else - imvImage._Paint(hZoom, hOffset.X, hOffset.Y) + If $sTool = "move" And If Not $bReadOnly And If $bPress Then + Paint.Save + Paint.ClipRect = Rect(hOffset.X, hOffset.Y, Ceil($hImage.W * imvImage.Zoom), Ceil($hImage.H * imvImage.Zoom)) + imvImage._Paint(hZoom, hOffset.X + CInt($hCurrentPoint.X - $hLastPoint.X) * imvImage.Zoom, hOffset.Y + CInt($hCurrentPoint.Y - $hLastPoint.Y) * imvImage.Zoom) + Paint.Restore + Else + imvImage._Paint(hZoom, hOffset.X, hOffset.Y) + Endif Endif diff --git a/app/src/gambas3/.src/Editor/Image/FImageProperty.class b/app/src/gambas3/.src/Editor/Image/FImageProperty.class index a74c2f539..a17a8dbd3 100644 --- a/app/src/gambas3/.src/Editor/Image/FImageProperty.class +++ b/app/src/gambas3/.src/Editor/Image/FImageProperty.class @@ -1,6 +1,6 @@ ' Gambas class file -Private $aDefaultColor As Integer[] = [Color.Black, Color.White, Color.DarkGray, &H606060, Color.Gray, &HA0A0A0, Color.LightGray, Color.Blue, Color.Cyan, Color.Green, Color.Yellow, Color.Orange, Color.Red, Color.Magenta] +Private $aDefaultColor As Integer[] = [Color.Black, Color.White, Color.DarkGray, &H606060, Color.Gray, &HA0A0A0, Color.LightGray, &HE0E0E0, Color.Blue, Color.Cyan, Color.Green, Color.Yellow, Color.Orange, Color.Red, Color.Magenta] Private $aGradient As New CReportBrush[] diff --git a/app/src/gambas3/.src/FMain.class b/app/src/gambas3/.src/FMain.class index 0821f07c2..512f0c1fb 100644 --- a/app/src/gambas3/.src/FMain.class +++ b/app/src/gambas3/.src/FMain.class @@ -132,30 +132,30 @@ Public Sub Form_Close() If Project.Close() Then Stop Event - Else - - Settings["/UseInheritance"] = Project.UseInheritance - Settings["/ShowAllClasses"] = Project.ShowAllClasses - - Settings.Write(Me) - Settings.Write(panProject, "panProject") - Settings.Write(panProperty, "panProperty") - Settings.Write(panTool, "panTool") - 'Settings.Write(panStack, "panStack") - Settings.Write(panDebug, "panDebug") - - ' We must close them now, otherwise the Close event is raised when the embedded forms - ' are destroyed, and then the Settings.Save() method gets no TopLevel form anymore for generating the - ' settings key ! - FProperty.Close - FOutput.Close - FDebugger.Close - FDebugInfo.Close - - Design.Exit - Project.Exit + Return Endif + Settings["/UseInheritance"] = Project.UseInheritance + Settings["/ShowAllClasses"] = Project.ShowAllClasses + + Settings.Write(Me) + Settings.Write(panProject, "panProject") + Settings.Write(panProperty, "panProperty") + Settings.Write(panTool, "panTool") + 'Settings.Write(panStack, "panStack") + Settings.Write(panDebug, "panDebug") + + ' We must close them now, otherwise the Close event is raised when the embedded forms + ' are destroyed, and then the Settings.Save() method gets no TopLevel form anymore for generating the + ' settings key ! + FProperty.Close + FOutput.Close + FDebugger.Close + FDebugInfo.Close + + Design.Exit + Project.Exit + End Private Sub OpenProject()