Skip to content

Commit

Permalink
Merge pull request #806 from OpenGeoscience/polygon-stroke-order
Browse files Browse the repository at this point in the history
Ensure that GL polygons are built once before their strokes.
  • Loading branch information
manthey authored Apr 11, 2018
2 parents a37fa8d + ab3635d commit 9e1317f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gl/polygonFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var gl_polygonFeature = function (arg) {
m_geometry,
s_init = this._init,
s_update = this._update,
m_builtOnce,
m_updateAnimFrameRef;

function createVertexShader() {
Expand Down Expand Up @@ -325,17 +326,20 @@ var gl_polygonFeature = function (arg) {

if (!m_this.renderer().contextRenderer().hasActor(m_actor)) {
m_this.renderer().contextRenderer().addActor(m_actor);
m_builtOnce = true;
}
m_this.buildTime().modified();
};

/**
* Update.
*
* @override
* @param {object} [opts] Update options.
* @param {boolean} [opts.mayDelay] If truthy, wait until the next animation
* frame for the update.
*/
this._update = function (opts) {
if (opts && opts.mayDelay) {
if (opts && opts.mayDelay && m_builtOnce) {
m_updateAnimFrameRef = m_this.layer().map().scheduleAnimationFrame(m_this._update);
return;
}
Expand Down

0 comments on commit 9e1317f

Please sign in to comment.