PureBasic Forumhttp://forums.purebasic.com/english/ Resizing shapes problemhttp://forums.purebasic.com/english/viewtopic.php?f=13&t=73054 Page 1 of 1

 Author: Mijikai [ Thu Jun 20, 2019 8:19 am ] Post subject: Re: Resizing shapes problem Try this Code:        If newH > 0;<- remove this

 Author: Demivec [ Thu Jun 20, 2019 8:22 am ] Post subject: Re: Resizing shapes problem This is untested but I think I found a problem in OnCanvasEvents(): Code:  newY = *b\y : newH = *b\h        newY + offset\y        newH - offset\y ;should be using offset\x

 Author: wombats [ Thu Jun 20, 2019 8:28 am ] Post subject: Re: Resizing shapes problem Thanks for the replies.Mijikai wrote:Try this Code:        If newH <> 0;<- change this          *b\y = newY          *b\h = newH          *b\handle\y = *b\y - 3        EndIfI can't use this as I don't want the shape to be resized to negative sizes.Demivec wrote:This is untested but I think I found a problem in OnCanvasEvents(): Code:  newY = *b\y : newH = *b\h        newY + offset\y        newH - offset\y ;should be using offset\xI don't make use of offset\x in the example because that would be for sizing handles working on the width.

 Author: wombats [ Thu Jun 20, 2019 8:53 am ] Post subject: Re: Resizing shapes problem That still allows the shape to be resized to a negative height.I'm trying to create similar behaviour to the Form editor in the IDE - it doesn't let you resize gadgets to less than 10x10.

 Author: Mijikai [ Thu Jun 20, 2019 9:03 am ] Post subject: Re: Resizing shapes problem Just do this:Code:        If newH > 9;if size > 9 change it          *b\y = newY          *b\h = newH           *b\handle\y = *b\y - 3        Else          PostEvent(#PB_Event_Gadget,EventWindow(),EventGadget(),#PB_EventType_LeftButtonUp);we are done!        EndIf