1234567891011121314151617181920212223242526272829303132333435363738 |
- import 'package:fis_measure/interfaces/process/items/item.dart';
- import 'package:fis_measure/interfaces/process/items/item_feature.dart';
- import 'package:flutter/painting.dart';
- import 'item_feature.dart';
- import 'top_item.dart';
- abstract class TopMeasureItemFeature extends MeasureItemFeature {
- TopMeasureItemFeature(ITopMeasureItem refItem) : super(refItem);
- @override
- TopMeasureItem get refItem => super.refItem as TopMeasureItem;
- @override
- void paint(Canvas canvas, Size size) {
- for (var item in refItem.childItems) {
- for (var feature in item.measuredFeatures) {
- if (feature.checkCanPaint()) {
- feature.paint(canvas, size);
- }
- }
- item.feature?.paint(canvas, size);
- }
- }
- @override
- void setZoomRect(Rect? rect) {
- zoomRect = rect;
- final List<IMeasureItemFeature> measureFeatures =
- refItem.childItems.expand((item) => item.measuredFeatures).toList();
- for (var feature in measureFeatures) {
- feature.setZoomRect(zoomRect);
- }
- for (var item in refItem.childItems) {
- item.feature?.setZoomRect(rect);
- }
- }
- }
|