Skip to content

Commit b49bed6

Browse files
committed
[fix] clamp rect by square but stupid
1 parent d73fd02 commit b49bed6

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

include/ekg/math/geometry.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
namespace ekg {
3232
typedef int32_t pixel_thickness_t;
3333
typedef float pixel_t;
34-
34+
3535
constexpr float pi {3.1415927f};
3636
constexpr float one_pixel {1.0000000f};
3737
constexpr float half_pixel {0.5000000f};
@@ -420,12 +420,12 @@ namespace ekg {
420420
ekg::rect_t<t> rect,
421421
float square
422422
) {
423-
const t zero {};
423+
const t zero {};
424424
return ekg::rect_t<t> {
425425
ekg::clamp_min<t>(rect.x, zero),
426426
ekg::clamp_min<t>(rect.y, zero),
427-
ekg::clamp_max<t>(rect.w, square),
428-
ekg::clamp_max<t>(rect.h, square)
427+
ekg::clamp_min<t>(rect.w, square),
428+
ekg::clamp_min<t>(rect.h, square)
429429
};
430430
}
431431

src/handler/theme/handler.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,15 @@ void ekg::handler::theme::init() {
134134
black_light_pinky_theme.popup_color_scheme = black_light_pinky_theme.frame_color_scheme;
135135
black_light_pinky_theme.popup_color_scheme.popup_mode = true;
136136

137-
light_pinky_theme.textbox_color_scheme.background = {204, 204, 204, 50};
138-
light_pinky_theme.textbox_color_scheme.outline = {190, 190, 190, 0};
139-
light_pinky_theme.textbox_color_scheme.text_foreground = {141, 141, 141, 255};
137+
black_light_pinky_theme.textbox_color_scheme.background = {242, 242, 242, 255};
138+
black_light_pinky_theme.textbox_color_scheme.outline = {190, 190, 190, 100};
139+
black_light_pinky_theme.textbox_color_scheme.text_foreground = {141, 141, 141, 255};
140+
black_light_pinky_theme.textbox_color_scheme.text_cursor_foreground = {141, 141, 141, 255};
141+
black_light_pinky_theme.textbox_color_scheme.text_select_foreground = {245, 169, 184, 50};
142+
black_light_pinky_theme.textbox_color_scheme.text_select_outline = {245, 169, 184, 100};
140143

141144
this->registry(black_light_pinky_theme.tag) = black_light_pinky_theme;
142-
//this->set_current_theme(black_light_pinky_theme.tag);
145+
this->set_current_theme(black_light_pinky_theme.tag);
143146
}
144147

145148
void ekg::handler::theme::quit() {

src/ui/frame/widget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void ekg::ui::event(
199199
}
200200
}
201201

202-
ekg::clamp_rect_by_square<float>(
202+
new_rect = ekg::clamp_rect_by_square<float>(
203203
new_rect,
204204
ekg::dpi.min_sizes
205205
);

0 commit comments

Comments
 (0)