简体   繁体   English

如何在摩纳哥编辑器中获取列的水平位置(左偏移)?

[英]How to get the horizontal position (left offset) for the colunm in monaco editor?

I need to convert the [lineNmber, column] coordinate to [x, y] pixel coordinate to the top-left, and I found API getTopForLineNumber and getTopForPosition to convert the lineNumber to vertical pixel coordinate, but I didn't find any API to convert column to horizontal pixel coordinate.我需要将 [lineNmber, column] 坐标转换为 [x, y] 像素坐标到左上角,我发现 API getTopForLineNumber 和 getTopForPosition 将 lineNumber 转换为垂直像素坐标,但我没有找到任何 API将列转换为水平像素坐标。 Is there any method to convert column to horizontal pixel coordinate?有什么方法可以将列转换为水平像素坐标?

尝试使用getOffsetForColumn方法从行的开头获取列的偏移量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM