mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Merge pull request #7807 from penpot/alotor-fix-hover-text
Some checks failed
_DEVELOP / build-bundle (push) Has been cancelled
_DEVELOP / build-docker (push) Has been cancelled
_STAGING / build-bundle (push) Has been cancelled
_STAGING / build-docker (push) Has been cancelled
Commit Message Check / Check Commit Message (push) Has been cancelled
CI: Tests / Integration Tests (push) Has been cancelled
Some checks failed
_DEVELOP / build-bundle (push) Has been cancelled
_DEVELOP / build-docker (push) Has been cancelled
_STAGING / build-bundle (push) Has been cancelled
_STAGING / build-docker (push) Has been cancelled
Commit Message Check / Check Commit Message (push) Has been cancelled
CI: Tests / Integration Tests (push) Has been cancelled
🐛 Fix hover text
This commit is contained in:
@@ -694,6 +694,7 @@ impl TextContent {
|
|||||||
(fallback_width, fallback_height)
|
(fallback_width, fallback_height)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn intersect_position_in_shape(&self, shape: &Shape, x_pos: f32, y_pos: f32) -> bool {
|
pub fn intersect_position_in_shape(&self, shape: &Shape, x_pos: f32, y_pos: f32) -> bool {
|
||||||
let rect = shape.selrect;
|
let rect = shape.selrect;
|
||||||
let mut matrix = Matrix::new_identity();
|
let mut matrix = Matrix::new_identity();
|
||||||
@@ -713,8 +714,6 @@ impl TextContent {
|
|||||||
x_pos >= rect.x() && x_pos <= rect.right() && y_pos >= rect.y() && y_pos <= rect.bottom()
|
x_pos >= rect.x() && x_pos <= rect.right() && y_pos >= rect.y() && y_pos <= rect.bottom()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leave this function for future use in the upcoming render editor
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn intersect_position_in_text(&self, shape: &Shape, x_pos: f32, y_pos: f32) -> bool {
|
pub fn intersect_position_in_text(&self, shape: &Shape, x_pos: f32, y_pos: f32) -> bool {
|
||||||
let rect = self.content_rect(&shape.selrect, shape.vertical_align);
|
let rect = self.content_rect(&shape.selrect, shape.vertical_align);
|
||||||
let mut matrix = Matrix::new_identity();
|
let mut matrix = Matrix::new_identity();
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ pub extern "C" fn intersect_position_in_shape(
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
if let Type::Text(content) = &shape.shape_type {
|
if let Type::Text(content) = &shape.shape_type {
|
||||||
return content.intersect_position_in_shape(shape, x_pos, y_pos);
|
return content.intersect_position_in_text(shape, x_pos, y_pos);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
false
|
false
|
||||||
|
|||||||
Reference in New Issue
Block a user