Skip to content

Add Hit Margin Theme Constant for BaseButton#116763

Open
Kazox61 wants to merge 1 commit intogodotengine:masterfrom
Kazox61:base-button-hit-margin
Open

Add Hit Margin Theme Constant for BaseButton#116763
Kazox61 wants to merge 1 commit intogodotengine:masterfrom
Kazox61:base-button-hit-margin

Conversation

@Kazox61
Copy link
Contributor

@Kazox61 Kazox61 commented Feb 25, 2026

Closes godotengine/godot-proposals#4338

This adds a Hit Margin Theme Constant for BaseButton.
The only way I found to implement this was by overriding the has_point for the BaseButton. This is needed since the BaseButton uses gui_input for detecting input and gui_input is only be called when has_point is true.

base_button_hit_margin.mp4

@Kazox61 Kazox61 requested review from a team as code owners February 25, 2026 15:36
@AThousandShips AThousandShips added this to the 4.x milestone Feb 25, 2026

DrawMode get_draw_mode() const;

bool has_point(const Point2 &p_point) const override;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
bool has_point(const Point2 &p_point) const override;
virtual bool has_point(const Point2 &p_point) const override;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a "hit margin" theme constant to BaseButton

2 participants