Add tests, remove unused code, encapsulate repeated code in functions
This commit is contained in:
@@ -94,3 +94,18 @@ ol.render.canvas.defaultTextBaseline = 'middle';
|
||||
* @type {number}
|
||||
*/
|
||||
ol.render.canvas.defaultLineWidth = 1;
|
||||
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {number} offsetX X offset.
|
||||
* @param {number} offsetY Y offset.
|
||||
*/
|
||||
ol.render.canvas.rotateAtOffset = function(context, rotation, offsetX, offsetY) {
|
||||
if (rotation !== 0) {
|
||||
context.translate(offsetX, offsetY);
|
||||
context.rotate(rotation);
|
||||
context.translate(-offsetX, -offsetY);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user