Halo: simplify effect::set_location
This commit is contained in:
parent
09e7ed97e8
commit
12d4a11959
1 changed files with 4 additions and 6 deletions
10
src/halo.cpp
10
src/halo.cpp
|
@ -168,12 +168,10 @@ halo_impl::effect::effect(int xpos, int ypos,
|
|||
|
||||
void halo_impl::effect::set_location(int x, int y)
|
||||
{
|
||||
int new_x = x - disp->get_location_x(map_location::ZERO());
|
||||
int new_y = y - disp->get_location_y(map_location::ZERO());
|
||||
if (new_x != abs_mid_.x || new_y != abs_mid_.y) {
|
||||
DBG_HL << "setting halo location " << point{new_x,new_y};
|
||||
abs_mid_.x = new_x;
|
||||
abs_mid_.y = new_y;
|
||||
point new_center = point{x, y} - disp->get_location(map_location::ZERO());
|
||||
if(new_center != abs_mid_) {
|
||||
DBG_HL << "setting halo location " << new_center;
|
||||
abs_mid_ = new_center;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue