Skip to content

Fix text_input::Renderer implementation in iced_wgpu#279

Merged
hecrj merged 2 commits into
masterfrom
fix/text-input-measure-value
Apr 9, 2020
Merged

Fix text_input::Renderer implementation in iced_wgpu#279
hecrj merged 2 commits into
masterfrom
fix/text-input-measure-value

Conversation

@hecrj

@hecrj hecrj commented Apr 9, 2020

Copy link
Copy Markdown
Member

This PR fixes and improves the text_input::Renderer implementation in iced_wgpu. Specifically:

  • It fixes the measure_value implementation, which was incorrectly measuring text when spaces were present at the start.
  • It makes the draw implementation only produce a Clip primitive when the text value overflows the input. This should improve performance, as Clip primitives are currently very expensive.

It accounts for spaces at the start of text now.
@hecrj hecrj added the bug Something isn't working label Apr 9, 2020
@hecrj hecrj added this to the 0.1.1 milestone Apr 9, 2020
@hecrj hecrj self-assigned this Apr 9, 2020
It should only produce a `Clip` primitive when the contents overflow the
input now.
@hecrj hecrj force-pushed the fix/text-input-measure-value branch from 1a7f097 to d3dee84 Compare April 9, 2020 03:17
@hecrj hecrj merged commit 19f6a5e into master Apr 9, 2020
@hecrj hecrj deleted the fix/text-input-measure-value branch April 9, 2020 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant