flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
598 stars 40 forks source link

Fix for `insertSubview` being off by one #309

Closed janek closed 4 years ago

janek commented 4 years ago

Fixes #308 Type of change: Bug fix

Motivation

We had a bug in insertSubview where we would use expected new positions in subview hierarchy before the hierarchy is updated. This fix uses the old hierarchy.

Visually in DemoApp it looks correct (where it previously was wrong). I also added a test that would fail on master, but passes here and on iOS.

Please check if the PR fulfills these requirements

codecov[bot] commented 4 years ago

Codecov Report

Merging #309 into master will increase coverage by 0.17%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #309      +/-   ##
==========================================
+ Coverage   51.97%   52.15%   +0.17%     
==========================================
  Files          87       87              
  Lines        3161     3160       -1     
==========================================
+ Hits         1643     1648       +5     
+ Misses       1518     1512       -6
Impacted Files Coverage Δ
Sources/UIView.swift 90.68% <100%> (+0.93%) :arrow_up:
Sources/CALayer.swift 88.43% <0%> (+2.72%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 30149b5...66f1f86. Read the comment docs.

janek commented 4 years ago

@ephemer yes it does! thanks!