🐛 Fix auto-width/fixed-width regression

This commit is contained in:
Aitor Moreno
2026-03-04 13:38:50 +01:00
parent 5474b1890b
commit e380886f51
3 changed files with 3 additions and 6 deletions

View File

@@ -334,8 +334,6 @@
:on-cut on-cut
:on-focus on-focus
:on-blur on-blur
;; FIXME on-click
;; :on-click on-click
:id "text-editor-wasm-input"
:class (dm/str (cur/get-dynamic "text" (:rotation shape))
" "

View File

@@ -673,7 +673,7 @@ impl TextContent {
});
let size = TextContentSize::new_with_normalized_line_height(
width,
width.ceil(),
paragraph_height.ceil(),
DEFAULT_TEXT_CONTENT_SIZE,
normalized_line_height,
@@ -708,12 +708,12 @@ impl TextContent {
pub fn set_layout_from_result(
&mut self,
result: TextContentLayoutResult,
default_height: f32,
default_width: f32,
default_height: f32,
) {
self.layout.set(result.0, result.1);
self.size
.copy_finite_size(result.2, default_height, default_width);
.copy_finite_size(result.2, default_width, default_height);
}
pub fn update_layout(&mut self, selrect: Rect) -> TextContentSize {

View File

@@ -308,7 +308,6 @@ pub extern "C" fn set_shape_text_content() -> crate::error::Result<()> {
#[no_mangle]
pub extern "C" fn set_shape_grow_type(grow_type: u8) {
let grow_type = RawGrowType::from(grow_type);
with_current_shape_mut!(state, |shape: &mut Shape| {
if let Type::Text(text_content) = &mut shape.shape_type {
text_content.set_grow_type(GrowType::from(grow_type));