Repository navigation
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
|
这个是不是直接在 xcpcio 改比较好 |
|
I have read the CLA Document and I hereby sign the CLA |
我感觉直接改html文件最方便。因为是Hydro本身对非1:1图片没做裁切处理导致的头像显示问题。 |
|
感觉道理上统一成正方形是有必要做的,圆角和边距改了反而更别扭 |
## Problem When a team badge image is not square (e.g. a rectangular photo or logo), the current `object-contain` rendering preserves the original aspect ratio. Different teams end up with inconsistently-shaped badges on the board, which looks broken — especially in the rank rows where badges are expected to fill a uniform square slot. This is the same issue downstream consumers have hit and patched around with custom CSS overrides (e.g. Hydro's scoreboard-xcpcio integration in hydro-dev/Hydro#1231). ## Change Add an opt-in `square` prop to `Badge` that switches the image to `aspect-square object-cover`, center-cropping the badge into a square. Pass it for team badges in: - `TeamUI.vue` — the big badge slot when it is showing the team badge (in compact layout this slot shows the org logo instead, which keeps the original aspect-preserving behavior), and the small inline badge in compact layout - `TeamCard.vue` — the team badge next to the org logo - `TeamModal.vue` — the large badge in the team detail header Organization logos are intentionally left on `object-contain` since they typically have meaningful aspect ratios (wide banners, etc.). ## Test plan - [x] `vue-tsc --noEmit` passes for `@xcpcio/board` - [x] `eslint` clean on touched files - [ ] Visual check on a contest with non-square team badges




scoreboard-xcpcio插件
问题
Hydro 将用户头像作为 XCPCIO 的队伍徽标展示。原有样式使用
object-contain,会保留图片的原始长宽比,因此长方形头像在榜单中仍呈长方形,导致头像区域的视觉效果不统一。修改
在
xcpcio_board.html中使用aspect-ratio: 1和object-fit: cover,将头像等比居中裁成正方形。验证
已将修改后的代码部署到实际生产环境中测试过,效果不错。
Summary by CodeRabbit