Code Monkey home page Code Monkey logo

Comments (12)

zmtzawqlp avatar zmtzawqlp commented on July 27, 2024

暂时没有计划。这个需要计算。偏移量

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024

觉得可以加个rect参数,让开发者自己去指定初始显示区域

from extended_image.

zmtzawqlp avatar zmtzawqlp commented on July 27, 2024

区域是根据Boxfit以及一些参数来计算得出的,不是那么简单的方式

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024

scale应该也会影响到rect,不知道中心点是不是更合适

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024

@zmtzawqlp 新版可以居中了,但是有个问题,ExtendedImageGesturePageView的时候,必须先其他方向平移一下才能左平移图片,否则左滑就是切换page

from extended_image.

zmtzawqlp avatar zmtzawqlp commented on July 27, 2024

是你操作的太快了吧,如果是这个问题的话,没法解决,手势那个时候还没有attach。我昨天没发现你说的这个问题呢。

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024

不是,等待了很久才操作,就好像默认左平移没有获取焦点一样

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024
        print("==================");
        print(gestureDetails.movePage(delta));
        print(currentPage != pageController.page);
        print( widget.canMovePage(gestureDetails));
        print("==================");
        if ((gestureDetails.movePage(delta) ||
                (currentPage != pageController.page)) &&
            widget.canMovePage(gestureDetails)) {
          _drag?.update(details);
        } else {
          if (currentPage == pageController.page) {
            extendedImageGestureState.gestureDetails = GestureDetails(
                offset: gestureDetails.offset +
                    delta * extendedImageGestureState.imageGestureConfig.speed,
                totalScale: gestureDetails.totalScale,
                gestureDetails: gestureDetails);
          }
        }
I/flutter (  965): ==================
I/flutter (  965): true
I/flutter (  965): false
I/flutter (  965): true
I/flutter (  965): ==================
I/flutter (  965): ==================
I/flutter (  965): true
I/flutter (  965): true
I/flutter (  965): ==================
I/flutter (  965): ==================
I/flutter (  965): true
I/flutter (  965): true
I/flutter (  965): ==================

这是左平移时的打印

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024
  bool movePage(Offset delta) {
    print(delta);
    print(boundary);
    print(_computeHorizontalBoundary);
    bool canMoveHorizontal = delta.dx != 0 &&
        ((delta.dx < 0 && boundary.right) ||
            (delta.dx > 0 && boundary.left) ||
            !_computeHorizontalBoundary);

    bool canMoveVertical = delta.dy != 0 &&
        ((delta.dy < 0 && boundary.bottom) ||
            (delta.dy > 0 && boundary.top) ||
            !_computeVerticalBoundary);

    return canMoveHorizontal || canMoveVertical || totalScale <= 1.0;
  }

@zmtzawqlp 默认boundary.left=true了,不应该是默认全部false吗?

if (_computeHorizontalBoundary) {
      //move right
      if (result.left > layoutRect.left) {
        result = Rect.fromLTWH(
            layoutRect.left, result.top, result.width, result.height);
        _boundary.left = true;
      }

      ///move left
      if (result.right <= layoutRect.right) {
        result = Rect.fromLTWH(layoutRect.right - result.width, result.top,
            result.width, result.height);
        _boundary.right = true;
      }
    }

本地把等号去掉,没有影响,功能也正常了,不知道会不会对其他场景有影响

from extended_image.

BadReese avatar BadReese commented on July 27, 2024

loading state 没居中..

from extended_image.

zmtzawqlp avatar zmtzawqlp commented on July 27, 2024

@BadReese loading state 默认是加载圈+文字,你的文字颜色跟背景一样吧。。( ╯□╰ ),你这个跟这个bug无关

from extended_image.

crazecoder avatar crazecoder commented on July 27, 2024

新版没毛病

from extended_image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.