mirror of
https://github.com/penpot/penpot.git
synced 2026-08-04 03:48:46 +00:00
🐛 Fix problem with position data in Firefox
This commit is contained in:
parent
b02e05e23d
commit
47abe09cfe
@ -1764,11 +1764,11 @@
|
|||||||
:direction (dr/translate-direction direction)
|
:direction (dr/translate-direction direction)
|
||||||
:font-id (get element :font-id)
|
:font-id (get element :font-id)
|
||||||
:font-family (get element :font-family)
|
:font-family (get element :font-family)
|
||||||
:font-size (get element :font-size)
|
:font-size (dm/str (get element :font-size) "px")
|
||||||
:font-weight (get element :font-weight)
|
:font-weight (get element :font-weight)
|
||||||
:text-transform (get element :text-transform)
|
:text-transform (get element :text-transform)
|
||||||
:text-decoration (get element :text-decoration)
|
:text-decoration (get element :text-decoration)
|
||||||
:letter-spacing (get element :letter-spacing)
|
:letter-spacing (dm/str (get element :letter-spacing) "px")
|
||||||
:font-style (get element :font-style)
|
:font-style (get element :font-style)
|
||||||
:fills (get element :fills)
|
:fills (get element :fills)
|
||||||
:text text})))))))
|
:text text})))))))
|
||||||
|
|||||||
@ -968,6 +968,11 @@ impl RenderState {
|
|||||||
.draw_rect(bounds, &paint);
|
.draw_rect(bounds, &paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Uncomment to debug the render_position_data
|
||||||
|
// if let Type::Text(text_content) = &shape.shape_type {
|
||||||
|
// text::render_position_data(self, fills_surface_id, &shape, text_content);
|
||||||
|
// }
|
||||||
|
|
||||||
self.surfaces.apply_mut(surface_ids, |s| {
|
self.surfaces.apply_mut(surface_ids, |s| {
|
||||||
s.canvas()
|
s.canvas()
|
||||||
.concat(&transform.invert().unwrap_or(Matrix::default()));
|
.concat(&transform.invert().unwrap_or(Matrix::default()));
|
||||||
|
|||||||
@ -1551,7 +1551,7 @@ pub fn calculate_text_layout_data(
|
|||||||
for (span_index, span) in text_para.children().iter().enumerate() {
|
for (span_index, span) in text_para.children().iter().enumerate() {
|
||||||
let text: String = span.apply_text_transform();
|
let text: String = span.apply_text_transform();
|
||||||
let text_len = text.encode_utf16().count();
|
let text_len = text.encode_utf16().count();
|
||||||
span_ranges.push((cur, cur + text_len + 1, span_index));
|
span_ranges.push((cur, cur + text_len, span_index));
|
||||||
cur += text_len;
|
cur += text_len;
|
||||||
}
|
}
|
||||||
for (start, end, span_index) in span_ranges {
|
for (start, end, span_index) in span_ranges {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user