javafx中控件的边界(Boundary)有3种:

第一种是控件本身的Boundary,可通过getLayoutBounds获取。

第二种是控件本身(不计算transforms)和特效的Boundary,可通过getBoundsInLocal,获取。

第三种是控件本身(计算transforms)和特效的Boundary,可通过getBoundsInParent获取。

控件没有Translate时,3种边界效果图如下(方框表示Boundary):

理解javafx中控件的边界

理解javafx中控件的边界

理解javafx中控件的边界

getLayoutBounds

getBoundsInLocal

getBoundsInParent

控件有Translate时,3种边界效果图如下:

理解javafx中控件的边界

理解javafx中控件的边界

理解javafx中控件的边界

getLayoutBounds

getBoundsInLocal

getBoundsInParent

源码下载地址...

更多源码下载...

相关文章:

  • 2021-04-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2021-12-30
  • 2021-12-16
猜你喜欢
  • 2021-09-13
  • 2021-12-23
  • 2022-01-17
  • 2022-01-01
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
相关资源
相似解决方案