mirror of
https://github.com/cursorless-dev/cursorless.git
synced 2024-10-03 20:37:50 +03:00
Add some documentation of SVG calculations
This commit is contained in:
parent
5cf8a8db87
commit
89501db38a
BIN
images/svg-calculations.png
Normal file
BIN
images/svg-calculations.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 508 KiB |
@ -107,6 +107,16 @@ export default class Decorations {
|
||||
return vscode.Uri.parse(`data:image/svg+xml;base64,${encoded}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an SVG from the hat SVG that pads, offsets and scales it to end up
|
||||
* in the right size / place relative to the character it will be placed over.
|
||||
* [This image](../images/svg-calculations.png) may or may not be helpful.
|
||||
*
|
||||
* @param fontMeasurements Info about the user's font
|
||||
* @param hatWidthToCharacterWidthRatio How wide should hats be relative to character width
|
||||
* @param hatVerticalOffset How far off top of characters should hats be
|
||||
* @returns An object with the new SVG and its measurements
|
||||
*/
|
||||
private processSvg(
|
||||
fontMeasurements: FontMeasurements,
|
||||
hatWidthToCharacterWidthRatio: number,
|
||||
|
Loading…
Reference in New Issue
Block a user