From dca1c8fb415d63a89f7ab4cbc1f7e149eaf6c657 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 16 Dec 2016 11:24:29 -0500 Subject: [PATCH] Add reflect icons --- data/core.yaml | 8 ++++++-- dist/locales/en.json | 10 ++++++++-- modules/operations/reflect.js | 7 ++++--- svg/iD-sprite.json | 6 ++++++ svg/iD-sprite.src.svg | 8 ++++++++ 5 files changed, 32 insertions(+), 7 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 360e4dbd7..7c7c4aff7 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -131,9 +131,13 @@ en: connected_to_hidden: This can't be moved because it is connected to a hidden feature. reflect: title: reflect - description: Reflect this area on the vertical axis. + description: + long: Reflect this object across its long axis. + short: Reflect this object across its short axis. key: T - annotation: Reflected an area. + annotation: + long: Reflected an area across its long axis. + short: Reflected an area across its short axis. too_large: This can't be reflected because not enough of it is currently visible. connected_to_hidden: This can't be reflected because it is connected to a hidden feature. rotate: diff --git a/dist/locales/en.json b/dist/locales/en.json index a0c77be0b..6e6c93eab 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -165,9 +165,15 @@ }, "reflect": { "title": "reflect", - "description": "Reflect this area on the vertical axis.", + "description": { + "long": "Reflect this object across its long axis.", + "short": "Reflect this object across its short axis." + }, "key": "T", - "annotation": "Reflected an area.", + "annotation": { + "long": "Reflected an area across its long axis.", + "short": "Reflected an area across its short axis." + }, "too_large": "This can't be reflected because not enough of it is currently visible.", "connected_to_hidden": "This can't be reflected because it is connected to a hidden feature." }, diff --git a/modules/operations/reflect.js b/modules/operations/reflect.js index e6d385315..6b7c44308 100644 --- a/modules/operations/reflect.js +++ b/modules/operations/reflect.js @@ -7,11 +7,12 @@ export function operationReflect(selectedIDs, context) { var entity = context.entity(entityId); var extent = entity.extent(context.graph()); var action = actionReflect(entityId, context.projection); + var axis = 'long'; var operation = function() { context.perform( action, - t('operations.reflect.annotation') + t('operations.reflect.annotation.' + axis) ); }; @@ -34,10 +35,10 @@ export function operationReflect(selectedIDs, context) { var disable = operation.disabled(); return disable ? t('operations.reflect.' + disable) : - t('operations.reflect.description'); + t('operations.reflect.description.' + axis); }; - operation.id = 'reflect'; + operation.id = 'reflect-' + axis; operation.keys = [t('operations.reflect.key')]; operation.title = t('operations.reflect.title'); diff --git a/svg/iD-sprite.json b/svg/iD-sprite.json index 36ca95c17..77bfbe314 100644 --- a/svg/iD-sprite.json +++ b/svg/iD-sprite.json @@ -264,6 +264,8 @@ "operation-simplify": { "viewBox": "400 380 20 20" }, "operation-smooth": { "viewBox": "420 380 20 20" }, "operation-continue": { "viewBox": "440 380 20 20" }, + "operation-reflect-long": { "viewBox": "460 380 20 20" }, + "operation-reflect-short": { "viewBox": "480 380 20 20" }, "operation-delete-shape": { "fill": "inherit" }, "operation-circularize-shape": { "fill": "inherit" }, @@ -287,6 +289,10 @@ "operation-smooth-shape2": { "fill": "currentColor" }, "operation-continue-shape": { "fill": "inherit" }, "operation-continue-shape2": { "fill": "currentColor" }, + "operation-reflect-long-shape": { "fill": "inherit" }, + "operation-reflect-long-shape2": { "fill": "currentColor" }, + "operation-reflect-short-shape": { "fill": "inherit" }, + "operation-reflect-short-shape2": { "fill": "currentColor" }, "logo-twitter": { "viewBox": "200 400 60 60" }, "logo-facebook": { "viewBox": "260 400 60 60" }, diff --git a/svg/iD-sprite.src.svg b/svg/iD-sprite.src.svg index 3fb136678..7a3195512 100644 --- a/svg/iD-sprite.src.svg +++ b/svg/iD-sprite.src.svg @@ -130,6 +130,14 @@ + + + + + + + +