Skip to content

Commit 14a429c

Browse files
committed
Better field naming
1 parent 89b1c35 commit 14a429c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kitty/decorations.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ static bool cmpr_point(Point a, Point b) { return a.val == b.val; }
748748
vt_cleanup(&seen); \
749749
}
750750

751-
typedef struct ClipRect { uint left, top, width, height; } ClipRect;
751+
typedef struct ClipRect { uint left, top, x_end, y_end; } ClipRect;
752752

753753
static void
754754
draw_parametrized_curve_with_derivative_and_antialiasing(
@@ -764,7 +764,7 @@ draw_parametrized_curve_with_derivative_and_antialiasing(
764764
const double min_step = step / 1000., max_step = step;
765765
RAII_ALLOC(FloatPoint, samples, malloc(sizeof(FloatPoint) * cap));
766766
if (!samples) fatal("Out of memory");
767-
ClipRect cr = clip_to ? *clip_to : (ClipRect){.width=self->width, .height=self->height};
767+
ClipRect cr = clip_to ? *clip_to : (ClipRect){.x_end=self->width, .y_end=self->height};
768768
while (true) {
769769
samples[i] = (FloatPoint){xfunc(curve_data, t) + x_offset, yfunc(curve_data, t) + y_offset};
770770
if (t >= 1.0) break;
@@ -782,9 +782,9 @@ draw_parametrized_curve_with_derivative_and_antialiasing(
782782
}
783783
}
784784
const uint num_samples = i;
785-
for (uint py = cr.top; py < cr.height; py++) {
785+
for (uint py = cr.top; py < cr.y_end; py++) {
786786
uint ypos = self->width * py;
787-
for (uint px = cr.left; px < cr.width; px++) {
787+
for (uint px = cr.left; px < cr.x_end; px++) {
788788
// Center of the current pixel
789789
double pixel_center_x = (double)px + 0.5;
790790
double pixel_center_y = (double)py + 0.5;
@@ -1426,11 +1426,11 @@ rounded_corner(Canvas *self, uint level, Corner which) {
14261426
uint cell_height_is_odd = (self->height / self->supersample_factor) & 1;
14271427
// adjust for odd cell dimensions to line up with box drawing lines
14281428
double x_offset = cell_width_is_odd ? 0 : 0.5, y_offset = cell_height_is_odd ? 0 : 0.5;
1429-
ClipRect cr = {.width=self->width, .height=self->height};
1429+
ClipRect cr = {.x_end=self->width, .y_end=self->height};
14301430
if (which & TOP_EDGE) cr.top = hline_limits(self, half_height(self), level).start;
1431-
else cr.height = hline_limits(self, half_height(self), level).end;
1431+
else cr.y_end = hline_limits(self, half_height(self), level).end;
14321432
if (which & LEFT_EDGE) cr.left = vline_limits(self, half_width(self), level).start;
1433-
else cr.width = vline_limits(self, half_width(self), level).end;
1433+
else cr.x_end = vline_limits(self, half_width(self), level).end;
14341434
draw_parametrized_curve_with_derivative_and_antialiasing(
14351435
self, &r, line_width, rectircle_x, rectircle_y, rectircle_x_prime, rectircle_y_prime, x_offset, y_offset, &cr);
14361436
// make the vertical stems be same brightness as straightline segments

0 commit comments

Comments
 (0)