Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    GeUserArea GetMinSize can't scale down

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 476 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 02/11/2017 at 11:07, xxxxxxxx wrote:

      Hello, I'm facing to a weird problem where I can't scale down my GeUserArea but I can scale up.

      Here is my code which is very basic

      def Sized(self, w, h) :
          print "SIZED| w:{} - h:{}".format(w, h)
          self._w = w
          self._h = h
          self.LayoutChanged()
        
      def GetMinSize(self) :
          print "GETMINSIZE| w:{} - h:{}".format(self._w, self._h)
          return self._w, self._h
      

      My final goal is to dynamicly limit the min width size but can still be dynamic.

      Thanks in advance

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 02/11/2017 at 12:01, xxxxxxxx wrote:

        Well, every time you size your userarea Sized is called, which sets self._w and self._h to the current size.
        While your GetMinSize returns these exact values. So, you cannot go less than your current size, since that's what you return as the minimal size. As a result, you can only resize larger.

        Your GetMinSize should return the actual minimal values and not the self._w, self._h which have been set by the Sized function.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 02/11/2017 at 13:08, xxxxxxxx wrote:

          Hoooo ok pretty stupid from me. Thanks solved.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post