Update viewport margins.
199074
def _update_viewport_margins(self):
        """"""
        top = 0
        left = 0
        right = 0
        bottom = 0
        for panel in self.panels_for_zone(Panel.Position.LEFT):
            if panel.isVisible():
                width = panel.sizeHint().width()
                left += width
        for panel in self.panels_for_zone(Panel.Position.RIGHT):
            if panel.isVisible():
                width = panel.sizeHint().width()
                right += width
        for panel in self.panels_for_zone(Panel.Position.TOP):
            if panel.isVisible():
                height = panel.sizeHint().height()
                top += height
        for panel in self.panels_for_zone(Panel.Position.BOTTOM):
            if panel.isVisible():
                height = panel.sizeHint().height()
                bottom += height
        self._margin_sizes = (top, left, right, bottom)
        self.editor.setViewportMargins(left, top, right, bottom)
295653
def update(self):
        '''
        
        '''
        self.image = self.blank.copy()
        
        bf = self.font.render(''.join(self.text[:self.cursor_loc]), 
                True, self.color)
        br = bf.get_rect().move(self.margin)
        
        af = self.font.render(''.join(self.text[self.cursor_loc:]), 
                True, self.color)
        
        cr = self.cursor.get_rect()
        cvec = Vector(br.w - cr.w, 0) + self.margin
        
        scroll = Vector()
        
        if cvec.x > self.rect.w:
            scroll.x = self.rect.w - cvec.x - self.font.size(' ')[0]
        
        vcenter_blit(self.image, bf, scroll + br)
        vcenter_blit(self.image, af, scroll + br.topright)
        
        if self.cursor_shown and self.focus and pygame.key.get_focused():
            vcenter_blit(self.image, self.cursor, scroll + cvec)
        
        if self.blink_frames != None:
            self.blinker += 1
            self.blinker %= self.blink_frames
            if not self.blinker:
                self.cursor_shown = not self.cursor_shown
1158172
function updateViewportAboveIO() {
    io.viewportAbove = stepEl.map((el, i) => {
      const marginTop = pageH - stepOffsetTop[i];
      const marginBottom = offsetMargin - viewH - stepOffsetHeight[i];
      const rootMargin = `${marginTop}px 0px ${marginBottom}px 0px`;
      const options = { rootMargin };
      // console.log(options);
      const obs = new IntersectionObserver(intersectViewportAbove, options);
      obs.observe(el);
      return obs;
    });
  }
304000
def _adjust_width(self):
        """"""
        if self.bar_width > self.max_iter:
            self.bar_width = int(self.max_iter)
1051217
function(){
            var x = this.x,
                y = this.y,
                fieldRange = this.fovFieldRange,
                direction = this.fovDirection,
                maxViewDistance = this.fovMaxViewDistance;
            this.fov.update(x, y, fieldRange, direction, maxViewDistance, this);
        }
1113907
function updateBounds() {
         var target = this.getScreenCanvas();
         var rect;

         if (typeof target.getBoundingClientRect === "undefined") {
           rect = {
             left: 0,
             top: 0,
             width: 0,
             height: 0
           };
         } else {
           rect = target.getBoundingClientRect();
         }

         this.parentBounds.setShape(rect.left, rect.top, rect.width, rect.height);
       }
1070060
def _updateTabStopWidth(self):
        
        self.setTabStopWidth(self.fontMetrics().width(' ' * self._indenter.width))
1060811
def apply_panes_settings(self):
        """"""
        for plugin in (self.widgetlist + self.thirdparty_plugins):
            features = plugin.FEATURES
            if CONF.get('main', 'vertical_dockwidget_titlebars'):
                features = features | QDockWidget.DockWidgetVerticalTitleBar
            plugin.dockwidget.setFeatures(features)
            plugin.update_margins()
148494
private void  viewportFill()
   {
      int    col;
      if (state.style.viewportFill instanceof SVG.Colour) {
         col = ((SVG.Colour) state.style.viewportFill).colour;
      } else if (state.style.viewportFill instanceof CurrentColor) {
         col = state.style.color.colour;
      } else {
         return;
      }
      if (state.style.viewportFillOpacity != null)
         col = colourWithOpacity(col, state.style.viewportFillOpacity);

      canvas.drawColor(col);
   }
507456
private void adaptDividerVisibilities() {
        if (scrollView != null) {
            adaptDividerVisibilities(scrollView.isScrolledToTop(), scrollView.isScrolledToBottom(),
                    false);
        } else if (listView != null) {
            adaptDividerVisibilities(isListViewScrolledToTop(listView),
                    isListViewScrolledToBottom(listView), false);
        }
    }
1213898
def update_views(self):
        """"""
        # Call the father's method
        super(Plugin, self).update_views()

        # Add specifics informations
        # Alert on signal thresholds
        for i in self.stats:
            self.views[i[self.get_key()]]['signal']['decoration'] = self.get_alert(i['signal'])
            self.views[i[self.get_key()]]['quality']['decoration'] = self.views[i[self.get_key()]]['signal']['decoration']
976442
def _update_line(self):
        
        w = self._border_width
        m = self.margin
        # border is drawn within the boundaries of the widget:
        #
        #  size = (8, 7)  margin=2
        #  internal rect = (3, 3, 2, 1)
        #  ........
        #  ........
        #  ..BBBB..
        #  ..B  B..
        #  ..BBBB..
        #  ........
        #  ........
        #
        l = b = m
        r = self.size[0] - m
        t = self.size[1] - m
        pos = np.array([
            [l, b], [l+w, b+w],
            [r, b], [r-w, b+w],
            [r, t], [r-w, t-w],
            [l, t], [l+w, t-w],
        ], dtype=np.float32)
        faces = np.array([
            [0, 2, 1],
            [1, 2, 3],
            [2, 4, 3],
            [3, 5, 4],
            [4, 5, 6],
            [5, 7, 6],
            [6, 0, 7],
            [7, 0, 1],
            [5, 3, 1],
            [1, 5, 7],
        ], dtype=np.int32)
        start = 8 if self._border_color.is_blank else 0
        stop = 8 if self._bgcolor.is_blank else 10
        face_colors = None
        if self._face_colors is not None:
            face_colors = self._face_colors[start:stop]
        self._mesh.set_data(vertices=pos, faces=faces[start:stop],
                            face_colors=face_colors)

        # picking mesh covers the entire area
        self._picking_mesh.set_data(vertices=pos[::2])
432001
private void updatePaddingBounds(@NonNull Rect viewBounds) {
        if (mIconPadding >= 0
                && mIconPadding * 2 <= viewBounds.width()
                && mIconPadding * 2 <= viewBounds.height()) {
            mPaddingBounds.set(
                    viewBounds.left + mIconPadding,
                    viewBounds.top + mIconPadding,
                    viewBounds.right - mIconPadding,
                    viewBounds.bottom - mIconPadding);
        }
    }
541098
def update(self):
        '''
        
        '''
        self.image = self.blank.copy()
        vcenter_blit(self.image, 
                self.font.render(self.get(), True, self.color), 
                self.margin)
1017124
protected function updateViewportFields()
    {
        foreach ($this->getViewports() as $viewport) {
            
            // Obtain Field:
            
            if (!($field = $this->getViewportField($viewport))) {
                continue;
            }
            
            // Update Title:
            
            $field->setTitle($this->getViewportLabel($viewport));
            
            // Update Hidden Status:
            
            if ($this->isViewportHidden($viewport)) {
                $field->addExtraClass('hidden');
            } else {
                $field->removeExtraClass('hidden');
            }
            
            // Update Dropdown Fields:
            
            if ($field instanceof DropdownField) {
                
                // Update Empty Strings:
                
                if ($field->hasMethod('setEmptyString')) {
                    $field->setEmptyString(' ')->setAttribute('data-placeholder', $this->emptyString);
                }
                
                // Update Source:
                
                $field->setSource($this->getSource());
                
            }
            
            // Update Disabled Flags:
            
            $field->setDisabled($this->disabled);
            
            // Update Readonly Flags:
            
            $field->setReadonly($this->readonly);
            
        }
    }
1093791
def adjust_cells(self):
        """"""
        self.resizeColumnsToContents()
        fm = self.horizontalHeader().fontMetrics()
        names = [fm.width(s.name + ' '*9) for s in self.source_model.shortcuts]
        self.setColumnWidth(NAME, max(names))
        self.horizontalHeader().setStretchLastSection(True)
894737
function () {
            // Sets properties of '_features' that change on resize and/or orientation.
            var w   = win.innerWidth || _viewport.clientWidth,
                h   = win.innerHeight || _viewport.clientHeight,
                dw  = win.screen.width,
                dh  = win.screen.height,
                c   = win.screen.colorDepth,
                x   = win.devicePixelRatio;

            _features.width                     = w;
            _features.height                    = h;
            _features['aspect-ratio']           = (w / h).toFixed(2);
            _features['device-width']           = dw;
            _features['device-height']          = dh;
            _features['device-aspect-ratio']    = (dw / dh).toFixed(2);
            _features.color                     = c;
            _features['color-index']            = Math.pow(2, c);
            _features.orientation               = (h >= w ? 'portrait' : 'landscape');
            _features.resolution                = (x && x * 96) || win.screen.deviceXDPI || 96;
            _features['device-pixel-ratio']     = x || 1;
        }