Skip to content

Add utility operators/methods to dart:html Point and Rect #9212

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

Closed
DartBot opened this issue Mar 16, 2013 · 5 comments
Closed

Add utility operators/methods to dart:html Point and Rect #9212

DartBot opened this issue Mar 16, 2013 · 5 comments
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. library-svg P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug web-libraries Issues impacting dart:html, etc., libraries

Comments

@DartBot
Copy link

DartBot commented Mar 16, 2013

This issue was originally filed by [email protected]


I would like a way to modify Point and Rect with more operators/methods:
  - get a new Point/Rect x pixels to the left/right/up/down.
  - scale a rectangle in either the x or y direction or both
    - This requires some extra information to determine to what point we're scaling. That is, do we scale and leave top left point where it is? Or keep the center where it is? I think this should be an option.
  - get the center of the rectangle, or the center of the sides
  - get the midpoint between two points
    - for that matter, get the centroid of n points.

Currently Point and Rect and special and individualized, I would love to see a generic Shape or Polygon class with any number of points defining the shape. Then you could get centroids, easily create polygon fills on a canvas, make more interesting bounding boxes for a series of shapes, do rotation, etc.

A Line class would be pretty useful, too, actually. Perhaps a Curve class as well. A Path class, as well, which is a sequence of Curves and Lines or the perimeter of a Shape.

What do you think about any of these ideas?

@blois
Copy link

blois commented May 23, 2013

Added this to the Later milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library label.

@efortuna
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Low label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@DartBot DartBot added Type-Enhancement P3 A lower priority bug or feature request library-html area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Aug 4, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@vsmenon vsmenon added the area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. label Jul 20, 2019
@joshualitt joshualitt added the web-libraries Issues impacting dart:html, etc., libraries label Nov 2, 2021
@lrhn lrhn removed the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label Feb 13, 2025
@lrhn lrhn closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. library-svg P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

9 participants