Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

make sorting symbols by y deterministic #3765

Closed

Description

@ansis

The order of symbols with the same y value (after rotation) is undefined, which is causing some differences with -js.

std::sort(symbolInstances.begin(), symbolInstances.end(), [sin, cos](SymbolInstance &a, SymbolInstance &b) {
const float aRotated = sin * a.x + cos * a.y;
const float bRotated = sin * b.x + cos * b.y;
return aRotated < bRotated;

Activity

  1. self-assigned this
    on Jan 29, 2016
  2. ansis commented on Feb 9, 2016

    @ansis
    ContributorAuthor

    done 2cfc624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions