- var from_y = (7 - arrow.from_row + 0.5)*square_width;
- var to_y = (7 - arrow.to_row + 0.5)*square_width;
- var from_x = (arrow.from_col + 0.5)*square_width;
- var to_x = (arrow.to_col + 0.5)*square_width;
+ var pos, from_y, to_y, from_x, to_x;
+ if (board.orientation() === 'black') {
+ pos = $(".square-h1").position();
+ from_y = (arrow.from_row + 0.5)*square_width;
+ to_y = (arrow.to_row + 0.5)*square_width;
+ from_x = (7 - arrow.from_col + 0.5)*square_width;
+ to_x = (7 - arrow.to_col + 0.5)*square_width;
+ } else {
+ pos = $(".square-a8").position();
+ from_y = (7 - arrow.from_row + 0.5)*square_width;
+ to_y = (7 - arrow.to_row + 0.5)*square_width;
+ from_x = (arrow.from_col + 0.5)*square_width;
+ to_x = (arrow.to_col + 0.5)*square_width;
+ }