Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
fix anchor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilKleistGao committed Oct 24, 2021
1 parent 65b2fb1 commit 37fb66e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/objects/entity_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ void EntityObject::init(const typename resources::ConfigResource::JsonObject& da
setRotation(data["rotate"].GetFloat());
setZOrder(data["z-order"].GetInt());

if (data.HasMember(("anchor"))) {
auto anchor = data["anchor"].GetObject();
setAnchorX(anchor["x"].GetFloat());
setAnchorY(anchor["y"].GetFloat());
}

if (data.HasMember("id")) {
_id = data["id"].GetInt();
}
Expand Down

0 comments on commit 37fb66e

Please # to comment.