mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
🐛 Fix auto-width/fixed-width regression
This commit is contained in:
parent
5474b1890b
commit
e380886f51
@ -334,8 +334,6 @@
|
|||||||
:on-cut on-cut
|
:on-cut on-cut
|
||||||
:on-focus on-focus
|
:on-focus on-focus
|
||||||
:on-blur on-blur
|
:on-blur on-blur
|
||||||
;; FIXME on-click
|
|
||||||
;; :on-click on-click
|
|
||||||
:id "text-editor-wasm-input"
|
:id "text-editor-wasm-input"
|
||||||
:class (dm/str (cur/get-dynamic "text" (:rotation shape))
|
:class (dm/str (cur/get-dynamic "text" (:rotation shape))
|
||||||
" "
|
" "
|
||||||
|
|||||||
@ -673,7 +673,7 @@ impl TextContent {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let size = TextContentSize::new_with_normalized_line_height(
|
let size = TextContentSize::new_with_normalized_line_height(
|
||||||
width,
|
width.ceil(),
|
||||||
paragraph_height.ceil(),
|
paragraph_height.ceil(),
|
||||||
DEFAULT_TEXT_CONTENT_SIZE,
|
DEFAULT_TEXT_CONTENT_SIZE,
|
||||||
normalized_line_height,
|
normalized_line_height,
|
||||||
@ -708,12 +708,12 @@ impl TextContent {
|
|||||||
pub fn set_layout_from_result(
|
pub fn set_layout_from_result(
|
||||||
&mut self,
|
&mut self,
|
||||||
result: TextContentLayoutResult,
|
result: TextContentLayoutResult,
|
||||||
default_height: f32,
|
|
||||||
default_width: f32,
|
default_width: f32,
|
||||||
|
default_height: f32,
|
||||||
) {
|
) {
|
||||||
self.layout.set(result.0, result.1);
|
self.layout.set(result.0, result.1);
|
||||||
self.size
|
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 {
|
pub fn update_layout(&mut self, selrect: Rect) -> TextContentSize {
|
||||||
|
|||||||
@ -308,7 +308,6 @@ pub extern "C" fn set_shape_text_content() -> crate::error::Result<()> {
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn set_shape_grow_type(grow_type: u8) {
|
pub extern "C" fn set_shape_grow_type(grow_type: u8) {
|
||||||
let grow_type = RawGrowType::from(grow_type);
|
let grow_type = RawGrowType::from(grow_type);
|
||||||
|
|
||||||
with_current_shape_mut!(state, |shape: &mut Shape| {
|
with_current_shape_mut!(state, |shape: &mut Shape| {
|
||||||
if let Type::Text(text_content) = &mut shape.shape_type {
|
if let Type::Text(text_content) = &mut shape.shape_type {
|
||||||
text_content.set_grow_type(GrowType::from(grow_type));
|
text_content.set_grow_type(GrowType::from(grow_type));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user