Rectangle function map missing trimmed
-
@aaronventure Oh good idea, I'm not actually subscribed to it for notifications, I will do that too
-
@Christoph-Hart It seems that
withBottom
,withBottomY
, andwithHeight
all do the same thing?HiseSnippet 931.3ocyV8taSiDDecZLhjCPfDO.V4Stmphhs6eRE5zQSZ6QzQKQjdniOg1rdc7pZuaz50zFg3ciGo6M3tY8lD6dMDJAPB+gHOyryL+xuc7LyPofPyxDRjUyKlMkhrdf8nYbUb+XLiiFbLx5Q1mgyTToiQUuYSwYYzPjk0V+gVgUi5nhm+426gSvbBsTEB8FAiPeIKkoJ0N74+IKI4TbH8BVZkSu6yGPD79hDQNfmsr6flhIWhmPOGqOVMazKvYwHqe01OZLwO5fftdG5c3A6dnm2dcGuaGeR3dGFDrePXjeW79cAmt2IgLkPNRgUzLHn8DgyFEKthaRvaXYrwITsfGZDjYiZT+XVR3vEjSFBYUeXIUskgpdp8YrP1R8kT1iKL3T5QURyp15fj2WAjrp.o5FH8D6QDIappzhFO+h8.NbCFgg6lpPwbVTs10s6KfSvUsSwWROUBBK8vc+Nc1wA9Y6m0rIb+jobdOV5LDyoIdN+lyBOmPU8EoSEbPvskwbKsOlWamQUCABR8ZQthwotQ4bhhI3tS1t4GZ1PGSLDNULKSGqWJH3jdhbdXlqN0MlzNBpZNJIw0Tg.mRRmosnskoytV8RqiSfhGiigR7UGkvlvogWPuFP2ULUbOgRIRasiCdGmVD.zRZXqOe3.qkn30ThxE2tLLt96sMX9iqfi7WOG4WxQ9+jxQu86DI810vRAqmkBJYofe5XoWPYShUeyjjILkbzh+VNB94BE8Ub2h+dM+XSm+uonnUZSSnRQRBUtRy5tux04nKOOcLUtCbMkjSWdPnayMagcu6VKLh49sxAE7Abl5USoykOUjDpaMoe+1M7PyKPf29qAGiUXcOv45fyMkJULMbrNl9dXpioiXC6ioYWpDSgntrpBfrpv5CWzuTWYgXPpuusoeE55pCllUU3JVnBFCYacMHFWbqok3nBHdmSge0TD9CIEAURwmj28Tb6AKvHMQXdBVcy4b5M.la.pbtwvE8.DdFSMq5FBeEC+5r1ge2UH9D6gLEId0Xr1JvHTS8i.iyWY3g1mDEAexWBv51m92a59Aegza5ON4LrRxf5.6yySGAcfHTH6bn5HSeeWSWQYj6nk0LvHJOrP3egm4F8zxVyM5svHJESjh2QL8KzKkb+BM.l3EKs0.1dDjc7PE8PpxyovNRuiPtYntki9apiAapi6toNt2l539apiGroN18K6ndE1ixgw1lOaPnyFdRQSWKqS3XnBrnZE8e.q7RdKB
-
@Christoph-Hart We seem to be missing
toArray
, I tried to add this myself but kept getting some weird errors that I don't understand. -
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
Also, not having .centre or getCentre() or .scaledCentred(scalingX, scalingY) is also a bummer, seems like really low hanging fruit.
-
@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?
@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
-
@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?
-
@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.
-
@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!
-
@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.
-
@d-healey yeah, there's withSizeKeepingCentre but that still requires fetching width and height first
Anyway, PR's up
- 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...
GitHub (github.com)
-
@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.