* Flip X "together" * @param {object} tAttachment The target attachment * @param {object} eAttachment The element attachment * @param {number[]} bounds Array of bounds of the format [left, top, right, bottom] * @param {number} width * @param targetWidth * @param {number} left * @private
(tAttachment, eAttachment, bounds, width, targetWidth, left)
| 161 | * @private |
| 162 | */ |
| 163 | function _flipXTogether(tAttachment, eAttachment, bounds, width, targetWidth, left) { |
| 164 | if (left < bounds[0] && tAttachment.left === 'left') { |
| 165 | if (eAttachment.left === 'right') { |
| 166 | left += targetWidth; |
| 167 | tAttachment.left = 'right'; |
| 168 | |
| 169 | left += width; |
| 170 | eAttachment.left = 'left'; |
| 171 | |
| 172 | } else if (eAttachment.left === 'left') { |
| 173 | left += targetWidth; |
| 174 | tAttachment.left = 'right'; |
| 175 | |
| 176 | left -= width; |
| 177 | eAttachment.left = 'right'; |
| 178 | } |
| 179 | |
| 180 | } else if (left + width > bounds[2] && tAttachment.left === 'right') { |
| 181 | if (eAttachment.left === 'left') { |
| 182 | left -= targetWidth; |
| 183 | tAttachment.left = 'left'; |
| 184 | |
| 185 | left -= width; |
| 186 | eAttachment.left = 'right'; |
| 187 | |
| 188 | } else if (eAttachment.left === 'right') { |
| 189 | left -= targetWidth; |
| 190 | tAttachment.left = 'left'; |
| 191 | |
| 192 | left += width; |
| 193 | eAttachment.left = 'left'; |
| 194 | } |
| 195 | |
| 196 | } else if (tAttachment.left === 'center') { |
| 197 | if (left + width > bounds[2] && eAttachment.left === 'left') { |
| 198 | left -= width; |
| 199 | eAttachment.left = 'right'; |
| 200 | |
| 201 | } else if (left < bounds[0] && eAttachment.left === 'right') { |
| 202 | left += width; |
| 203 | eAttachment.left = 'left'; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | return left; |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * Flip Y "together" |
no outgoing calls
no test coverage detected
searching dependent graphs…