(cm, lineObj, rect, context, includeWidgets)
| 3920 | // "line", "div" (display.lineDiv), "local"./null (editor), "window", |
| 3921 | // or "page". |
| 3922 | function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { |
| 3923 | if (!includeWidgets) { |
| 3924 | var height = widgetTopHeight(lineObj) |
| 3925 | rect.top += height |
| 3926 | rect.bottom += height |
| 3927 | } |
| 3928 | if (context == "line") { |
| 3929 | return rect |
| 3930 | } |
| 3931 | if (!context) { |
| 3932 | context = "local" |
| 3933 | } |
| 3934 | var yOff = heightAtLine(lineObj) |
| 3935 | if (context == "local") { |
| 3936 | yOff += paddingTop(cm.display) |
| 3937 | } else { |
| 3938 | yOff -= cm.display.viewOffset |
| 3939 | } |
| 3940 | if (context == "page" || context == "window") { |
| 3941 | var lOff = cm.display.lineSpace.getBoundingClientRect() |
| 3942 | yOff += lOff.top + (context == "window" ? 0 : pageScrollY()) |
| 3943 | var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()) |
| 3944 | rect.left += xOff |
| 3945 | rect.right += xOff |
| 3946 | } |
| 3947 | rect.top += yOff |
| 3948 | rect.bottom += yOff |
| 3949 | return rect |
| 3950 | } |
| 3951 | |
| 3952 | // Coverts a box from "div" coords to another coordinate system. |
| 3953 | // Context may be "window", "page", "div", or "local"./null. |
no test coverage detected