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

Response Sense Recognition Issue #4006

Closed
wants to merge 10 commits into from
Closed

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Feb 8, 2024

Closes #3989

@emilk
Please review to see if there are any problems.

This Pull Request is Invalid clip_rect.
(For example, when the image is enlarged.)

self.ctx.layer_painter(self.layer_id).clip_rect() => Invalid
self.ctx.used_rect() => Invalid
self.ctx.available_rect() => Invalid
self.ctx.screen_rect() => Invalid
self.rect => Invalid

Is there a way to include ui.clip_rect in Response ?
or
Is there a way to not include ui.clip_rect in Response ?

I think ui.clip_rect needs to be included in Response.
ui.clip_rect To Response.clip_rect

@rustbasic
Copy link
Contributor Author

rustbasic commented Feb 8, 2024

I think,
This PR is for reference by emilk in fixing bugs.

This causes a bug where several buttons cannot be hovered and cannot be clicked.

@emilk
Copy link
Owner

emilk commented Feb 8, 2024

Before we switch away from interact_with_hovered I want to understand why it no longer works

@rustbasic
Copy link
Contributor Author

rustbasic commented Feb 9, 2024

The moment you click, self.hovered changes from true to false.
And false is passed to self.ctx.interact_with_hovered().
Should you find a way to fix this?

May be,
Should we save the results of all events first?

egui/crates/egui/src/widgets/image.rs : fn ui(self, ui: &mut Ui)
337 line
let (rect, response) = ui.allocate_exact_size(ui_size, self.sense);
to
let (rect, response) = ui.allocate_exact_size(ui_size, egui::Sense::click_and_drag());

it's a good result.
But, One problem found in this case is that the Image in the ScrollArea cannot be dragged with the mouse after being enlarged.
then,

    `let (rect, response) = ui.allocate_exact_size(ui_size, egui::Sense::click_and_drag());`
    to
    `let (rect, response) = ui.allocate_exact_size(ui_size, egui::Sense::click());`

it's a good result.

Or, Should it be this way?

  1. First, save all information with click_and_drag().
  2. Then, information is removed according to the Sense settings.
    May be, Remove it from the interact() function

Please refer to the contents so far.

emilk added a commit that referenced this pull request Feb 10, 2024
@emilk
Copy link
Owner

emilk commented Feb 10, 2024

Closed by #4013

@emilk emilk closed this Feb 10, 2024
@rustbasic rustbasic deleted the patch7 branch February 10, 2024 10:00
@rustbasic rustbasic mentioned this pull request Feb 10, 2024
emilk added a commit that referenced this pull request Feb 10, 2024
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
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.

Response::interact doesn't always work
2 participants