HISE Logo Forum
    • Categories
    • Register
    • Login

    Rectangle function map missing trimmed

    Scheduled Pinned Locked Moved General Questions
    18 Posts 2 Posters 454 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.
    • A
      aaronventure
      last edited by aaronventure

      Referring to any property will return the last one referred, so if you refer to rect.x and then to rect.wtf, the second one will return rect.x

      daccea06-2a0d-4481-8d6e-4d7349d3c4ad-image.png

      Also, not having .centre or getCentre() or .scaledCentred(scalingX, scalingY) is also a bummer, seems like really low hanging fruit.

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @aaronventure
        last edited by d.healey

        @aaronventure said in Rectangle function map missing trimmed:

        Referring to any property will return the last one referred, so if you refer to rect.x and then to rect.wtf, the second one will return rect.x

        Not sure what you mean here, got a snippet?

        fa3e2d19-d7db-4018-b02d-7c6c0da7068a-image.png

        @aaronventure said in Rectangle function map missing trimmed:

        Also, not having .centre or getCentre() or .scaledCentred(scalingX, scalingY) is also a bummer, seems like really low hanging fruit.

        We have .withCentre and .reduced

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        A 1 Reply Last reply Reply Quote 0
        • A
          aaronventure @d.healey
          last edited by

          @d-healey said in Rectangle function map missing trimmed:

          Not sure what you mean here, got a snippet?

          Call .x in a print command, then change the property to .whatever and hit F5 again.

          @d-healey said in Rectangle function map missing trimmed:

          We have .withCentre and .reduced

          Alright I actually managed to add scaledCentre to the source, it works but it's not showing up in the API or autocomplete. How do I do that before making a PR?

          d.healeyD 1 Reply Last reply Reply Quote 1
          • d.healeyD
            d.healey @aaronventure
            last edited by d.healey

            @aaronventure said in Rectangle function map missing trimmed:

            Call .x in a print command, then change the property to .whatever and hit F5 again.

            I see, so you if you use a non-existent key it returns the value from the last valid key you used.

            @aaronventure said in Rectangle function map missing trimmed:

            Alright I actually managed to add scaledCentre to the source,

            What is the difference between this and reduced()?

            Functions we add don't show up in the API because Christoph has to run some magic batch script for that.

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            A 1 Reply Last reply Reply Quote 0
            • A
              aaronventure @d.healey
              last edited by

              @d-healey said in Rectangle function map missing trimmed:

              What is the difference between this and reduced()?

              Reduced trims half what you put in from each side, scaledCentre allows you to put in a scaling factor while keeping the rectangle centred. You could technically do it with reduced by writing a custom function of course, i mean you can do with scaled by adding a translation, but you can say that for half of the methods in the class.

              @d-healey said in Rectangle function map missing trimmed:

              Functions we add don't show up in the API because Christoph has to run some magic batch script for that.

              Interesting. Alright, then!

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @aaronventure
                last edited by d.healey

                @aaronventure said in Rectangle function map missing trimmed:

                scaledCentre allows you to put in a scaling factor while keeping the rectangle centred.

                Isn't that the same as .scaled()?

                Oh I see, scaled only works from the top left corner.

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                A 1 Reply Last reply Reply Quote 0
                • A
                  aaronventure @d.healey
                  last edited by

                  @d-healey yeah, there's withSizeKeepingCentre but that still requires fetching width and height first

                  Anyway, PR's up

                  Link Preview Image
                  - add centre-related methods to the Rectangle class by aaronventure · Pull Request #717 · christophhart/HISE

                  Added getCentre(), getCentreX() and getCentreY() from the base Rectangle class Added scaledCentre() which will perform factor scaling while keeping the same centre Removed that unused p because why...

                  favicon

                  GitHub (github.com)

                  1 Reply Last reply Reply Quote 1
                  • d.healeyD
                    d.healey @d.healey
                    last edited by

                    @d-healey said in Rectangle function map missing trimmed:

                    We seem to be missing toArray, I tried to add this myself but kept getting some weird errors that I don't understand.

                    Solved

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    1 Reply Last reply Reply Quote 1
                    • d.healeyD
                      d.healey
                      last edited by d.healey

                      Looks like .setCentre doesn't work, and why are there two setSize functions?

                      ac4a8759-704d-430a-b6c1-643bb5262cea-image.png

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey
                        last edited by

                        When using g.addNoise() the area parameter is still expecting an array.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

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

                        18

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.7k

                        Posts