Skip to content

How to adjust the size of thumbnail #178

@Ken-ST

Description

@Ken-ST

When I use ThumbnailPane to wrap the thumbnail of pdf, I find that the height of the container is fixed. No matter how I adjust the size of each thumbnail with css, the height of the container has never changed. The height of the container can only be fully filled using the initial height, which means that if I change the initial height, there will be a lot of blanks left.

Belows are some codes and pics

    <ThumbnailsPane
      style={{
        paddingBottom: 20,
        // width: 150,
      }}
      selectedPage={currentPage}
    >
      {m => (
        <Flex
          key={m.pageIndex}
          align="center"
          style={{
            width: "100%",
            padding: 8,
          }}
          onClick={() => {
            scrollProvide?.scrollToPage?.({
              pageNumber: m.pageIndex + 1,
            });
          }}
        >
          <Flex
            className="custom-thumbnail"
            style={{
              height: m.wrapperHeight,
              borderColor: currentPage === m.pageIndex + 1 ? "#FFA42E" : token.colorBorder,
            }}
          >
            <ThumbImg
              meta={m}
              style={{
                width: "100%",
                height: "100%",
                objectFit: "contain",
              }}
            />
            <div className="thumbnail-index">{m.pageIndex + 1}</div>
          </Flex>
        </Flex>
      )}
    </ThumbnailsPane>
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions