docs(Path): clarify that zero-length contours are excluded from computeMetrics#180165
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds documentation to Path.computeMetrics to clarify that zero-length contours are excluded from the results. The change is correct and improves the documentation. I have one minor suggestion to rephrase the added text for better conciseness and clarity.
| /// Zero-length contours (where the start and end points are the same, such as | ||
| /// `Path()..lineTo(0, 0)`) are not included in the returned [PathMetrics]. | ||
| /// Only contours with a positive length will have a corresponding [PathMetric]. |
There was a problem hiding this comment.
This is a great clarification. To make it a bit more concise and place the main rule first for better readability, consider rephrasing this paragraph.
/// Only contours with a positive length will have a corresponding [PathMetric].
/// Zero-length contours are not included, such as one created by
/// `Path()..lineTo(0, 0)`.|
autosubmit label was removed for flutter/flutter/180165, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR. |
|
autosubmit label was removed for flutter/flutter/180165, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
|
autosubmit label was removed for flutter/flutter/180165, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
|
This should have included a test to make sure that we continue to observe this condition. It may be forgotten later when we replace the path implementation. |
|
Issue filed to add a test case: #182854 |
…from computeMetrics (flutter/flutter#180165)
…from computeMetrics (flutter/flutter#180165)
…from computeMetrics (flutter/flutter#180165)
…from computeMetrics (flutter/flutter#180165)
…from computeMetrics (flutter/flutter#180165)
Roll Flutter from dad6f9d4107a to b31548feb941 (39 revisions) flutter/flutter@dad6f9d...b31548f 2026-02-25 mdebbar@google.com [web] Fix failure on Firefox 148 (flutter/flutter#182855) 2026-02-25 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from KfPgw04T0OEADLJA5... to XI0Ax7fbtYE4XKYAQ... (flutter/flutter#182887) 2026-02-25 50643541+Mairramer@users.noreply.github.com Use AnimationStyle curve and reverseCurve in ModalBottomSheet animation (flutter/flutter#181403) 2026-02-25 engine-flutter-autoroll@skia.org Roll Dart SDK from fd3dce5b6a4e to 5c57e75f1102 (9 revisions) (flutter/flutter#182801) 2026-02-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (#182697)" (flutter/flutter#182879) 2026-02-25 ahmedsameha1@gmail.com Make sure that an AnimatedSlide doesn't crash in 0x0 environment (flutter/flutter#181535) 2026-02-24 jmccandless@google.com Reland Standardize on Test* widgets in *_tester.dart files (flutter/flutter#182632) 2026-02-24 nhan13574@gmail.com docs(Path): clarify that zero-length contours are excluded from computeMetrics (flutter/flutter#180165) 2026-02-24 mdebbar@google.com Fix typo in assert message (flutter/flutter#182843) 2026-02-24 matej.knopp@gmail.com [win32] Fix overflow in TaskRunnerWindow. (flutter/flutter#182822) 2026-02-24 abadasamuelosp@gmail.com feat: Add --no-uninstall flag to flutter test for integration tests (flutter/flutter#182714) 2026-02-24 74057391+jhonathanqz@users.noreply.github.com Rename noFrequencyBasedMinification to useFrequencyBasedMinification (flutter/flutter#182684) 2026-02-24 60122246+xiaowei-guan@users.noreply.github.com [Impeller] Fix fail to render pixel buffer texture on Linux (flutter/flutter#181656) 2026-02-24 15619084+vashworth@users.noreply.github.com Remove FlutterFramework app migration (flutter/flutter#182100) 2026-02-24 engine-flutter-autoroll@skia.org Roll Packages from 12b43a1 to 062c8d4 (5 revisions) (flutter/flutter#182839) 2026-02-24 mdebbar@google.com [web] Run webparagraph tests in CI (flutter/flutter#182092) 2026-02-24 jason-simmons@users.noreply.github.com Fix a race in EmbedderTest.CanSpecifyCustomUITaskRunner (flutter/flutter#182649) 2026-02-24 srawlins@google.com flutter_tools: Use a super-parameter in several missed cases (flutter/flutter#182581) 2026-02-24 116356835+AbdeMohlbi@users.noreply.github.com Replace more references to `flutter/engine` with `flutter/flutter` (flutter/flutter#182654) 2026-02-24 50643541+Mairramer@users.noreply.github.com Carousel: Migration from Scrollable+Viewport to CustomScrollView (flutter/flutter#182475) 2026-02-24 97480502+b-luk@users.noreply.github.com Refactor impellerc_main to better organize some of its logic (flutter/flutter#182783) 2026-02-24 116356835+AbdeMohlbi@users.noreply.github.com Remove unused `getPluginList ` (flutter/flutter#182660) 2026-02-24 34465683+rkishan516@users.noreply.github.com Refactor: Remove material from ticker provider test (flutter/flutter#181697) 2026-02-24 engine-flutter-autoroll@skia.org Roll Skia from 26eebffe12bd to f44d7db68805 (3 revisions) (flutter/flutter#182821) 2026-02-24 34465683+rkishan516@users.noreply.github.com refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182697) 2026-02-24 engine-flutter-autoroll@skia.org Roll Skia from 7dad66aae75a to 26eebffe12bd (5 revisions) (flutter/flutter#182810) 2026-02-24 pokepsi@gmail.com Update roadmap for 2026 (flutter/flutter#182798) 2026-02-24 fluttergithubbot@gmail.com Marks Windows tool_tests_commands_1_2 to be unflaky (flutter/flutter#179670) 2026-02-23 zhongliu88889@gmail.com [web] scroll iOS iframe text input into view (flutter/flutter#179759) 2026-02-23 Mail@maikwild.de Fix textscaler clamp assertion error (flutter/flutter#181716) 2026-02-23 engine-flutter-autoroll@skia.org Roll Skia from 9a5a3c92c336 to 7dad66aae75a (4 revisions) (flutter/flutter#182779) 2026-02-23 116356835+AbdeMohlbi@users.noreply.github.com Move more getters from userMessages class to the appropriate places (flutter/flutter#182656) 2026-02-23 engine-flutter-autoroll@skia.org Manual roll Dart SDK from f8fac50475b8 to fd3dce5b6a4e (6 revisions) (flutter/flutter#182768) 2026-02-23 15619084+vashworth@users.noreply.github.com Copy Flutter framework to Add to App FlutterPluginRgistrant (flutter/flutter#182523) 2026-02-23 mr-peipei@web.de Add progress indicator to artifact downloads (flutter/flutter#181808) 2026-02-23 47866232+chunhtai@users.noreply.github.com Clarify batch release mode requirements (flutter/flutter#182228) 2026-02-23 mdebbar@google.com [web] Remove --disable-gpu from flutter chrome tests (flutter/flutter#182618) 2026-02-23 jwren@google.com running-apps: update running-apps to use Duration.ago() (flutter/flutter#182172) 2026-02-23 kevmoo@users.noreply.github.com Refactor bin/ shell scripts for better performance and safety (flutter/flutter#182674) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC louisehsu@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. ...
…teMetrics (flutter#180165) Add documentation clarifying that zero-length contours are not included in the PathMetrics returned by computeMetrics. Fixes flutter#179668 Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>
…r#11116) Roll Flutter from dad6f9d4107a to b31548feb941 (39 revisions) flutter/flutter@dad6f9d...b31548f 2026-02-25 mdebbar@google.com [web] Fix failure on Firefox 148 (flutter/flutter#182855) 2026-02-25 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from KfPgw04T0OEADLJA5... to XI0Ax7fbtYE4XKYAQ... (flutter/flutter#182887) 2026-02-25 50643541+Mairramer@users.noreply.github.com Use AnimationStyle curve and reverseCurve in ModalBottomSheet animation (flutter/flutter#181403) 2026-02-25 engine-flutter-autoroll@skia.org Roll Dart SDK from fd3dce5b6a4e to 5c57e75f1102 (9 revisions) (flutter/flutter#182801) 2026-02-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (#182697)" (flutter/flutter#182879) 2026-02-25 ahmedsameha1@gmail.com Make sure that an AnimatedSlide doesn't crash in 0x0 environment (flutter/flutter#181535) 2026-02-24 jmccandless@google.com Reland Standardize on Test* widgets in *_tester.dart files (flutter/flutter#182632) 2026-02-24 nhan13574@gmail.com docs(Path): clarify that zero-length contours are excluded from computeMetrics (flutter/flutter#180165) 2026-02-24 mdebbar@google.com Fix typo in assert message (flutter/flutter#182843) 2026-02-24 matej.knopp@gmail.com [win32] Fix overflow in TaskRunnerWindow. (flutter/flutter#182822) 2026-02-24 abadasamuelosp@gmail.com feat: Add --no-uninstall flag to flutter test for integration tests (flutter/flutter#182714) 2026-02-24 74057391+jhonathanqz@users.noreply.github.com Rename noFrequencyBasedMinification to useFrequencyBasedMinification (flutter/flutter#182684) 2026-02-24 60122246+xiaowei-guan@users.noreply.github.com [Impeller] Fix fail to render pixel buffer texture on Linux (flutter/flutter#181656) 2026-02-24 15619084+vashworth@users.noreply.github.com Remove FlutterFramework app migration (flutter/flutter#182100) 2026-02-24 engine-flutter-autoroll@skia.org Roll Packages from 12b43a1 to 062c8d4 (5 revisions) (flutter/flutter#182839) 2026-02-24 mdebbar@google.com [web] Run webparagraph tests in CI (flutter/flutter#182092) 2026-02-24 jason-simmons@users.noreply.github.com Fix a race in EmbedderTest.CanSpecifyCustomUITaskRunner (flutter/flutter#182649) 2026-02-24 srawlins@google.com flutter_tools: Use a super-parameter in several missed cases (flutter/flutter#182581) 2026-02-24 116356835+AbdeMohlbi@users.noreply.github.com Replace more references to `flutter/engine` with `flutter/flutter` (flutter/flutter#182654) 2026-02-24 50643541+Mairramer@users.noreply.github.com Carousel: Migration from Scrollable+Viewport to CustomScrollView (flutter/flutter#182475) 2026-02-24 97480502+b-luk@users.noreply.github.com Refactor impellerc_main to better organize some of its logic (flutter/flutter#182783) 2026-02-24 116356835+AbdeMohlbi@users.noreply.github.com Remove unused `getPluginList ` (flutter/flutter#182660) 2026-02-24 34465683+rkishan516@users.noreply.github.com Refactor: Remove material from ticker provider test (flutter/flutter#181697) 2026-02-24 engine-flutter-autoroll@skia.org Roll Skia from 26eebffe12bd to f44d7db68805 (3 revisions) (flutter/flutter#182821) 2026-02-24 34465683+rkishan516@users.noreply.github.com refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182697) 2026-02-24 engine-flutter-autoroll@skia.org Roll Skia from 7dad66aae75a to 26eebffe12bd (5 revisions) (flutter/flutter#182810) 2026-02-24 pokepsi@gmail.com Update roadmap for 2026 (flutter/flutter#182798) 2026-02-24 fluttergithubbot@gmail.com Marks Windows tool_tests_commands_1_2 to be unflaky (flutter/flutter#179670) 2026-02-23 zhongliu88889@gmail.com [web] scroll iOS iframe text input into view (flutter/flutter#179759) 2026-02-23 Mail@maikwild.de Fix textscaler clamp assertion error (flutter/flutter#181716) 2026-02-23 engine-flutter-autoroll@skia.org Roll Skia from 9a5a3c92c336 to 7dad66aae75a (4 revisions) (flutter/flutter#182779) 2026-02-23 116356835+AbdeMohlbi@users.noreply.github.com Move more getters from userMessages class to the appropriate places (flutter/flutter#182656) 2026-02-23 engine-flutter-autoroll@skia.org Manual roll Dart SDK from f8fac50475b8 to fd3dce5b6a4e (6 revisions) (flutter/flutter#182768) 2026-02-23 15619084+vashworth@users.noreply.github.com Copy Flutter framework to Add to App FlutterPluginRgistrant (flutter/flutter#182523) 2026-02-23 mr-peipei@web.de Add progress indicator to artifact downloads (flutter/flutter#181808) 2026-02-23 47866232+chunhtai@users.noreply.github.com Clarify batch release mode requirements (flutter/flutter#182228) 2026-02-23 mdebbar@google.com [web] Remove --disable-gpu from flutter chrome tests (flutter/flutter#182618) 2026-02-23 jwren@google.com running-apps: update running-apps to use Duration.ago() (flutter/flutter#182172) 2026-02-23 kevmoo@users.noreply.github.com Refactor bin/ shell scripts for better performance and safety (flutter/flutter#182674) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC louisehsu@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. ...
…teMetrics (flutter#180165) Add documentation clarifying that zero-length contours are not included in the PathMetrics returned by computeMetrics. Fixes flutter#179668 Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com>
…r#11116) Roll Flutter from dad6f9d4107a to b31548feb941 (39 revisions) flutter/flutter@dad6f9d...b31548f 2026-02-25 mdebbar@google.com [web] Fix failure on Firefox 148 (flutter/flutter#182855) 2026-02-25 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from KfPgw04T0OEADLJA5... to XI0Ax7fbtYE4XKYAQ... (flutter/flutter#182887) 2026-02-25 50643541+Mairramer@users.noreply.github.com Use AnimationStyle curve and reverseCurve in ModalBottomSheet animation (flutter/flutter#181403) 2026-02-25 engine-flutter-autoroll@skia.org Roll Dart SDK from fd3dce5b6a4e to 5c57e75f1102 (9 revisions) (flutter/flutter#182801) 2026-02-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (#182697)" (flutter/flutter#182879) 2026-02-25 ahmedsameha1@gmail.com Make sure that an AnimatedSlide doesn't crash in 0x0 environment (flutter/flutter#181535) 2026-02-24 jmccandless@google.com Reland Standardize on Test* widgets in *_tester.dart files (flutter/flutter#182632) 2026-02-24 nhan13574@gmail.com docs(Path): clarify that zero-length contours are excluded from computeMetrics (flutter/flutter#180165) 2026-02-24 mdebbar@google.com Fix typo in assert message (flutter/flutter#182843) 2026-02-24 matej.knopp@gmail.com [win32] Fix overflow in TaskRunnerWindow. (flutter/flutter#182822) 2026-02-24 abadasamuelosp@gmail.com feat: Add --no-uninstall flag to flutter test for integration tests (flutter/flutter#182714) 2026-02-24 74057391+jhonathanqz@users.noreply.github.com Rename noFrequencyBasedMinification to useFrequencyBasedMinification (flutter/flutter#182684) 2026-02-24 60122246+xiaowei-guan@users.noreply.github.com [Impeller] Fix fail to render pixel buffer texture on Linux (flutter/flutter#181656) 2026-02-24 15619084+vashworth@users.noreply.github.com Remove FlutterFramework app migration (flutter/flutter#182100) 2026-02-24 engine-flutter-autoroll@skia.org Roll Packages from 12b43a1 to 062c8d4 (5 revisions) (flutter/flutter#182839) 2026-02-24 mdebbar@google.com [web] Run webparagraph tests in CI (flutter/flutter#182092) 2026-02-24 jason-simmons@users.noreply.github.com Fix a race in EmbedderTest.CanSpecifyCustomUITaskRunner (flutter/flutter#182649) 2026-02-24 srawlins@google.com flutter_tools: Use a super-parameter in several missed cases (flutter/flutter#182581) 2026-02-24 116356835+AbdeMohlbi@users.noreply.github.com Replace more references to `flutter/engine` with `flutter/flutter` (flutter/flutter#182654) 2026-02-24 50643541+Mairramer@users.noreply.github.com Carousel: Migration from Scrollable+Viewport to CustomScrollView (flutter/flutter#182475) 2026-02-24 97480502+b-luk@users.noreply.github.com Refactor impellerc_main to better organize some of its logic (flutter/flutter#182783) 2026-02-24 116356835+AbdeMohlbi@users.noreply.github.com Remove unused `getPluginList ` (flutter/flutter#182660) 2026-02-24 34465683+rkishan516@users.noreply.github.com Refactor: Remove material from ticker provider test (flutter/flutter#181697) 2026-02-24 engine-flutter-autoroll@skia.org Roll Skia from 26eebffe12bd to f44d7db68805 (3 revisions) (flutter/flutter#182821) 2026-02-24 34465683+rkishan516@users.noreply.github.com refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182697) 2026-02-24 engine-flutter-autoroll@skia.org Roll Skia from 7dad66aae75a to 26eebffe12bd (5 revisions) (flutter/flutter#182810) 2026-02-24 pokepsi@gmail.com Update roadmap for 2026 (flutter/flutter#182798) 2026-02-24 fluttergithubbot@gmail.com Marks Windows tool_tests_commands_1_2 to be unflaky (flutter/flutter#179670) 2026-02-23 zhongliu88889@gmail.com [web] scroll iOS iframe text input into view (flutter/flutter#179759) 2026-02-23 Mail@maikwild.de Fix textscaler clamp assertion error (flutter/flutter#181716) 2026-02-23 engine-flutter-autoroll@skia.org Roll Skia from 9a5a3c92c336 to 7dad66aae75a (4 revisions) (flutter/flutter#182779) 2026-02-23 116356835+AbdeMohlbi@users.noreply.github.com Move more getters from userMessages class to the appropriate places (flutter/flutter#182656) 2026-02-23 engine-flutter-autoroll@skia.org Manual roll Dart SDK from f8fac50475b8 to fd3dce5b6a4e (6 revisions) (flutter/flutter#182768) 2026-02-23 15619084+vashworth@users.noreply.github.com Copy Flutter framework to Add to App FlutterPluginRgistrant (flutter/flutter#182523) 2026-02-23 mr-peipei@web.de Add progress indicator to artifact downloads (flutter/flutter#181808) 2026-02-23 47866232+chunhtai@users.noreply.github.com Clarify batch release mode requirements (flutter/flutter#182228) 2026-02-23 mdebbar@google.com [web] Remove --disable-gpu from flutter chrome tests (flutter/flutter#182618) 2026-02-23 jwren@google.com running-apps: update running-apps to use Duration.ago() (flutter/flutter#182172) 2026-02-23 kevmoo@users.noreply.github.com Refactor bin/ shell scripts for better performance and safety (flutter/flutter#182674) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC louisehsu@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. ...
Add documentation clarifying that zero-length contours are not included in the PathMetrics returned by computeMetrics.
Fixes #179668