| 819 | } |
| 820 | |
| 821 | void ApplyAreaFeature::ProcessAreaRules(AreaRuleProto const * areaRule, AreaRuleProto const * hatchingRule) |
| 822 | { |
| 823 | ASSERT(areaRule || hatchingRule, ()); |
| 824 | ASSERT(HasGeometry(), ()); |
| 825 | |
| 826 | double areaDepth = drule::kBaseDepthBgBySize - 1; |
| 827 | |
| 828 | if (hatchingRule) |
| 829 | { |
| 830 | ASSERT_GREATER_OR_EQUAL(hatchingRule->priority(), drule::kBasePriorityFg, (m_f.DebugString())); |
| 831 | ProcessRule(*hatchingRule, areaDepth, true /* isHatching */); |
| 832 | } |
| 833 | |
| 834 | if (areaRule) |
| 835 | { |
| 836 | // Calculate areaDepth for BG-by-size areas only. |
| 837 | if (areaRule->priority() < drule::kBasePriorityBgTop) |
| 838 | areaDepth = drule::CalcAreaBySizeDepth(m_f); |
| 839 | ProcessRule(*areaRule, areaDepth, false /* isHatching */); |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | void ApplyAreaFeature::ProcessRule(AreaRuleProto const & areaRule, double areaDepth, bool isHatching) |
| 844 | { |
no test coverage detected