Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cell-drawer): member can not display when cell is active #WIK-17077 #234

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions packages/grid/src/renderer/drawers/cell-drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ export class CellDrawer extends Drawer {
if (!userInfo) continue;

const { uid, display_name, avatar } = userInfo;
const type = AITableMemberType.member;
const itemWidth = AITableAvatarSize.size24 + (isMulti ? AI_TABLE_CELL_MEMBER_ITEM_PADDING : 0);

currentX = AI_TABLE_CELL_PADDING + index * itemWidth;
Expand All @@ -616,23 +615,23 @@ export class CellDrawer extends Drawer {
let isMore = currentX + itemWidth > columnWidth - 2 * AI_TABLE_CELL_PADDING;
if (columnWidth != null) {
// 在非活动状态下,当超出列宽时,不会渲染后续内容
if (!isActive && currentX >= columnWidth - 2 * AI_TABLE_CELL_PADDING) {
if (currentX >= columnWidth - 2 * AI_TABLE_CELL_PADDING) {
break;
}
// 如果不是非活动状态的最后一行,则换行渲染溢出内容
if (!isActive && currentX > columnWidth - 2 * AI_TABLE_CELL_PADDING) {
if (currentX > columnWidth - 2 * AI_TABLE_CELL_PADDING) {
currentX = AI_TABLE_CELL_PADDING;
}
if (isActive && currentX + itemWidth > columnWidth - AI_TABLE_CELL_PADDING) {
if (currentX + itemWidth > columnWidth - AI_TABLE_CELL_PADDING) {
currentX = AI_TABLE_CELL_PADDING;
currentY += itemHeight;
}
if (isActive && currentY >= maxHeight) {
if (currentY >= maxHeight) {
isOverflow = true;
}
}

if (ctx && !isActive) {
if (ctx) {
this.avatar({
x: x + currentX,
y: y + currentY,
Expand Down
Loading