Skip to content
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

No Rectangle Select Tool #203

Open
Nick-Sohacki opened this issue Oct 11, 2022 · 1 comment
Open

No Rectangle Select Tool #203

Nick-Sohacki opened this issue Oct 11, 2022 · 1 comment

Comments

@Nick-Sohacki
Copy link

I want to be able to select a rectangular area so I can move it around. I can try changing the code if someone points me in the right direction.

@MaciejWieczor
Copy link

The best idea I have on adding somthing like this would be looking into this:

milton/src/milton.cc

Lines 1601 to 1617 in 768c035

if ( milton->current_mode == MiltonMode::EXPORTING ) {
Exporter* exporter = &milton->gui->exporter;
b32 changed = exporter_input(exporter, input);
{
i32 x = min(exporter->pivot.x, exporter->needle.x);
i32 y = min(exporter->pivot.y, exporter->needle.y);
i32 w = MLT_ABS(exporter->pivot.x - exporter->needle.x);
i32 h = MLT_ABS(exporter->pivot.y - exporter->needle.y);
float left = 2*((float) x / (milton->view->screen_size.w))-1;
float right = 2*((GLfloat)(x+w) / (milton->view->screen_size.w))-1;
float top = -(2*((GLfloat)y / (milton->view->screen_size.h))-1);
float bottom = -(2*((GLfloat)(y+h) / (milton->view->screen_size.h))-1);
imm_rect(milton->renderer, left, right, top, bottom, 2.0);
}

That maybe could be used to get some rectangle. There is no cut out and drag and drop tool as far as I know right now though, so that would need to be added.

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

No branches or pull requests

2 participants