Skip to content

Add new expressions #2558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 25, 2021
Merged

Add new expressions #2558

merged 12 commits into from
Apr 25, 2021

Conversation

Bouh
Copy link
Collaborator

@Bouh Bouh commented Apr 17, 2021

Close #2367

The center of the object is used, we should explain this somewhere?

image

to_delete

@Bouh Bouh requested a review from 4ian as a code owner April 17, 2021 12:35
@Bouh
Copy link
Collaborator Author

Bouh commented Apr 17, 2021

Ready for a review.

@4ian
Copy link
Owner

4ian commented Apr 18, 2021

Nice! Would you be able to also add "free" expressions (without an object) XFromAngleAndDistance/Y? :)

@Bouh Bouh closed this Apr 18, 2021
@Bouh Bouh reopened this Apr 18, 2021
@Bouh
Copy link
Collaborator Author

Bouh commented Apr 18, 2021

Nice! Would you be able to also add "free" expressions (without an object) XFromAngleAndDistance/Y? :)

Yes with a number parameter instead the object position yes.

I've tried to made the changes from - to + but the result is same in preview.
I use - because the other functions use it, see getAngleToPosition
image
And other:
image

@Bouh
Copy link
Collaborator Author

Bouh commented Apr 18, 2021

I think the syntax for the C++ part is basic, i don't know how to call constant for Pi, so i've used a basic 3.1415.
I get no error when i compile gd.js.

@Bouh Bouh force-pushed the Add_new_expressions branch from 4cfca8b to 501d5ba Compare April 18, 2021 18:41
* @param distance The distance from the object, in pixels.
*/
export const XFromAngleAndDistance = function (
positionX: float,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the positionX argument :) Usually these expressions just take angle/distance as the origin is considered by default.

Copy link
Collaborator Author

@Bouh Bouh Apr 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What ?!
This is the free expression, we need a starting position.
Or i miss something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@4ian This is the free expression, the expression based object is on the other file. See my other comment.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Silver-Streak What do you think? Usually in these mathematical/vector helper functions, 0;0 is always considered as the origin. I'm just a bit afraid of XFromAngleAndDistance(100, 45, 100) being more cryptic than 100 + XFromAngleAndDistance(45, 100).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooohh okey I see what you mean now, i agree with you 100 + XFromAngleAndDistance(45, 100) is better, I'll remove position.

@Bouh Bouh requested a review from 4ian April 25, 2021 16:18
Copy link
Owner

@4ian 4ian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, almost there! 👍

@Bouh Bouh force-pushed the Add_new_expressions branch from 4232c85 to 921f19b Compare April 25, 2021 19:32
@Bouh
Copy link
Collaborator Author

Bouh commented Apr 25, 2021

It's ready to merge, i've made changes and tested.
Let me know!

@4ian 4ian merged commit 5f4fde7 into 4ian:master Apr 25, 2021
@4ian
Copy link
Owner

4ian commented Apr 25, 2021

Merged, thanks!

@Bouh
Copy link
Collaborator Author

Bouh commented Apr 25, 2021

Thanks you too!

@Bouh Bouh deleted the Add_new_expressions branch April 25, 2021 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants