Point wind arrow in the direction the wind is flowing (#3022)

Fixes #3019

The previous implementation had the arrow pointing in to the wind. When
the wind blows from the north (0 degrees), the arrow should point
straight down. In other words, no rotation of the arrow-down symbol.
When the wind blows from the south (180 degrees), the arrow should point
straight up (I.e. the arrow down symbol rotated 180 degrees).

Co-authored-by: Magnus Marthinsen <magmar@online.no>
This commit is contained in:
Magnus 2023-01-22 11:41:19 +01:00 committed by GitHub
parent 2e2962d492
commit 67e4dbaacd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -34,6 +34,7 @@ _This release is scheduled to be released on 2023-04-01._
- Fix message display with HTML code into alert module (#2828) - Fix message display with HTML code into alert module (#2828)
- Fix typo into french translation - Fix typo into french translation
- Yr wind direction is no longer inverted - Yr wind direction is no longer inverted
- The wind direction arrow now points in the direction the wind is flowing, not into the wind.
## [2.22.0] - 2023-01-01 ## [2.22.0] - 2023-01-01

View File

@ -7,7 +7,7 @@
{% if config.showWindDirection %} {% if config.showWindDirection %}
<sup> <sup>
{% if config.showWindDirectionAsArrow %} {% if config.showWindDirectionAsArrow %}
<i class="fas fa-long-arrow-alt-up" style="transform:rotate({{ current.windFromDirection }}deg);"></i> <i class="fas fa-long-arrow-alt-down" style="transform:rotate({{ current.windFromDirection }}deg);"></i>
{% else %} {% else %}
{{ current.cardinalWindDirection() | translate }} {{ current.cardinalWindDirection() | translate }}
{% endif %} {% endif %}

View File

@ -46,7 +46,7 @@ describe("Weather module", () => {
}); });
it("should render windDirection with an arrow", async () => { it("should render windDirection with an arrow", async () => {
const elem = await helpers.waitForElement(".weather .normal.medium sup i.fa-long-arrow-alt-up"); const elem = await helpers.waitForElement(".weather .normal.medium sup i.fa-long-arrow-alt-down");
expect(elem).not.toBe(null); expect(elem).not.toBe(null);
expect(elem.outerHTML).toContain("transform:rotate(250deg);"); expect(elem.outerHTML).toContain("transform:rotate(250deg);");
}); });