/* TODO(#891): LabelLayer doesn't show the final position of Label after the animation */
for (size_t i = 0; i < n; ++i) {
if (label_layer->state == LABEL_LAYER_EDIT_TEXT) {
- // TODO(#965): LabelLayer Edit Field should be rendered inside of the world
- if (edit_field_render_screen(
+ if (edit_field_render_world(
label_layer->edit_field,
camera,
- camera_point(camera, positions[i])) < 0) {
+ positions[i]) < 0) {
return -1;
}
} else {
{
trace_assert(edit_field);
trace_assert(camera);
- (void) world_position;
+
+ const float cursor_y_overflow = 10.0f;
+ const float cursor_width = 2.0f;
+
+ if (camera_render_text(
+ camera,
+ edit_field->buffer,
+ edit_field->font_size,
+ edit_field->font_color,
+ world_position) < 0) {
+ return -1;
+ }
+
+ if (camera_fill_rect(
+ camera,
+ rect(world_position.x + (float) edit_field->cursor * (float) FONT_CHAR_WIDTH * edit_field->font_size.x,
+ world_position.y - cursor_y_overflow,
+ cursor_width,
+ FONT_CHAR_HEIGHT * edit_field->font_size.y + cursor_y_overflow * 2.0f),
+ edit_field->font_color) < 0) {
+ return -1;
+ }
return 0;
}